mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
Add unittest [WIP]
This commit is contained in:
31
Wox.Test/Plugins/PluginInitTest.cs
Normal file
31
Wox.Test/Plugins/PluginInitTest.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Wox.Core.Exception;
|
||||
using Wox.Core.Plugin;
|
||||
using Wox.Plugin;
|
||||
|
||||
namespace Wox.Test.Plugins
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
public class PluginInitTest
|
||||
{
|
||||
[Test]
|
||||
public void CouldNotFindUserProfileTest()
|
||||
{
|
||||
var api = new Mock<IPublicAPI>();
|
||||
Environment.SetEnvironmentVariable("USERPROFILE", "");
|
||||
Assert.Throws(typeof(WoxCritialException), () => PluginManager.Init(api.Object));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void PublicAPIIsNullTest()
|
||||
{
|
||||
Assert.Throws(typeof(WoxCritialException), () => PluginManager.Init(null));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user