本文整理汇总了C#中Fixture.NewPrigExecutor方法的典型用法代码示例。如果您正苦于以下问题:C# Fixture.NewPrigExecutor方法的具体用法?C# Fixture.NewPrigExecutor怎么用?C# Fixture.NewPrigExecutor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fixture
的用法示例。
在下文中一共展示了Fixture.NewPrigExecutor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartInstalling_should_do_nothing_if_it_will_be_executed_after_the_2nd_time
public void StartInstalling_should_do_nothing_if_it_will_be_executed_after_the_2nd_time()
{
using (var prigConfig = new FileInfo(AppDomain.CurrentDomain.GetPathInBaseDirectory(@"tools\Prig.config")).BeginModifying())
{
try
{
// Arrange
prigConfig.Info.Delete();
Environment.SetEnvironmentVariable("URASANDESU_PRIG_PACKAGE_FOLDER", AppDomain.CurrentDomain.BaseDirectory);
var fixture = new Fixture().Customize(new AutoMoqCustomization());
{
var m = new Mock<IEnvironmentRepository>(MockBehavior.Strict);
m.Setup(_ => _.GetPrigPath()).Returns(AppDomain.CurrentDomain.GetPathInBaseDirectory(@"tools\prig.exe"));
fixture.Inject(m);
}
var source = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(source);
var prigExecutor = fixture.NewPrigExecutor();
// Act
prigExecutor.StartInstalling("TestWindow", source);
var result = prigExecutor.StartInstalling("TestWindow", source);
// Assert
Assert.That(result, Is.StringMatching(@"The specified source:.* has already installed\."));
}
finally
{
Environment.SetEnvironmentVariable("URASANDESU_PRIG_PACKAGE_FOLDER", null);
}
}
}
示例2: StartInstalling_should_install_specified_source
public void StartInstalling_should_install_specified_source()
{
using (var prigConfig = new FileInfo(AppDomain.CurrentDomain.GetPathInBaseDirectory(@"tools\Prig.config")).BeginModifying())
{
try
{
// Arrange
prigConfig.Info.Delete();
Environment.SetEnvironmentVariable("URASANDESU_PRIG_PACKAGE_FOLDER", AppDomain.CurrentDomain.BaseDirectory);
var fixture = new Fixture().Customize(new AutoMoqCustomization());
{
var m = new Mock<IEnvironmentRepository>(MockBehavior.Strict);
m.Setup(_ => _.GetPrigPath()).Returns(AppDomain.CurrentDomain.GetPathInBaseDirectory(@"tools\prig.exe"));
fixture.Inject(m);
}
var source = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(source);
var prigExecutor = fixture.NewPrigExecutor();
// Act
var result = prigExecutor.StartInstalling("TestWindow", source);
// Assert
Assert.IsEmpty(result);
Assert.AreEqual(6, Directory.GetFiles(source).Length);
}
finally
{
Environment.SetEnvironmentVariable("URASANDESU_PRIG_PACKAGE_FOLDER", null);
}
}
}
示例3: StartUninstalling_should_do_nothing_if_it_has_not_installed_yet
public void StartUninstalling_should_do_nothing_if_it_has_not_installed_yet()
{
using (var prigConfig = new FileInfo(AppDomain.CurrentDomain.GetPathInBaseDirectory(@"tools\Prig.config")).BeginModifying())
{
try
{
// Arrange
prigConfig.Info.Delete();
Environment.SetEnvironmentVariable("URASANDESU_PRIG_PACKAGE_FOLDER", AppDomain.CurrentDomain.BaseDirectory);
var fixture = new Fixture().Customize(new AutoMoqCustomization());
{
var m = new Mock<IEnvironmentRepository>(MockBehavior.Strict);
m.Setup(_ => _.GetPrigPath()).Returns(AppDomain.CurrentDomain.GetPathInBaseDirectory(@"tools\prig.exe"));
fixture.Inject(m);
}
var source = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(source);
var prigExecutor = fixture.NewPrigExecutor();
// Act
var result = prigExecutor.StartUninstalling("All");
// Assert
Assert.That(result, Is.StringMatching(@"The specified package:.* is not found. It might have been already uninstalled."));
CollectionAssert.IsEmpty(Directory.GetFiles(source));
}
finally
{
Environment.SetEnvironmentVariable("URASANDESU_PRIG_PACKAGE_FOLDER", null);
}
}
}