PowerToys/Wox.Test/Plugins/PluginInitTest.cs
2014-12-29 23:02:50 +08:00

32 lines
743 B
C#

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));
}
}
}