2011-11-17 04:40:55 +03:00
|
|
|
//using System;
|
|
|
|
//using System.Diagnostics;
|
|
|
|
//using FluentAssertions;
|
|
|
|
//using Moq;
|
|
|
|
//using NUnit.Framework;
|
2013-01-03 04:09:13 +03:00
|
|
|
////using NzbDrone.Common;
|
2011-11-17 04:40:55 +03:00
|
|
|
//using NzbDrone.Common.Model;
|
|
|
|
//using NzbDrone.Providers;
|
|
|
|
//using NzbDrone.Test.Common;
|
|
|
|
//using NzbDrone.Test.Dummy;
|
2011-11-14 06:37:36 +03:00
|
|
|
|
2011-11-17 04:40:55 +03:00
|
|
|
//namespace NzbDrone.App.Test
|
|
|
|
//{
|
|
|
|
// [TestFixture]
|
|
|
|
// public class IISProviderFixture : TestBase
|
|
|
|
// {
|
|
|
|
// [Test]
|
|
|
|
// public void should_update_pid_env_varibles()
|
|
|
|
// {
|
|
|
|
// WithTempAsAppPath();
|
2011-11-14 06:37:36 +03:00
|
|
|
|
2011-11-17 04:40:55 +03:00
|
|
|
// var dummy = StartDummyProcess();
|
2011-11-14 06:37:36 +03:00
|
|
|
|
2011-11-17 04:40:55 +03:00
|
|
|
// Environment.SetEnvironmentVariable(EnviromentProvider.NZBDRONE_PID, "0");
|
|
|
|
// Environment.SetEnvironmentVariable(EnviromentProvider.NZBDRONE_PATH, "Test");
|
2011-11-14 06:37:36 +03:00
|
|
|
|
2011-11-17 04:40:55 +03:00
|
|
|
// Mocker.GetMock<ProcessProvider>()
|
|
|
|
// .Setup(c => c.Start(It.IsAny<ProcessStartInfo>()))
|
|
|
|
// .Returns(dummy);
|
2011-11-14 06:37:36 +03:00
|
|
|
|
2011-11-17 04:40:55 +03:00
|
|
|
// Mocker.Resolve<IISProvider>().StartServer();
|
|
|
|
// }
|
2011-11-14 06:37:36 +03:00
|
|
|
|
2011-11-17 04:40:55 +03:00
|
|
|
// [Test]
|
|
|
|
// public void should_set_iis_procces_id()
|
|
|
|
// {
|
|
|
|
// WithTempAsAppPath();
|
|
|
|
// var dummy = StartDummyProcess();
|
2011-11-14 06:37:36 +03:00
|
|
|
|
2011-11-17 04:40:55 +03:00
|
|
|
// Mocker.GetMock<ProcessProvider>()
|
|
|
|
// .Setup(c => c.Start(It.IsAny<ProcessStartInfo>()))
|
|
|
|
// .Returns(dummy);
|
2011-11-14 06:37:36 +03:00
|
|
|
|
2011-11-17 04:40:55 +03:00
|
|
|
// //act
|
|
|
|
// Mocker.Resolve<IISProvider>().StartServer();
|
2011-11-14 06:37:36 +03:00
|
|
|
|
2011-11-17 04:40:55 +03:00
|
|
|
// //assert
|
|
|
|
// Mocker.Resolve<IISProvider>().IISProcessId.Should().Be(dummy.Id);
|
|
|
|
// }
|
2011-11-14 06:37:36 +03:00
|
|
|
|
|
|
|
|
2011-11-17 04:40:55 +03:00
|
|
|
// public Process StartDummyProcess()
|
|
|
|
// {
|
|
|
|
// var startInfo = new ProcessStartInfo(DummyApp.DUMMY_PROCCESS_NAME + ".exe");
|
|
|
|
// startInfo.UseShellExecute = false;
|
|
|
|
// startInfo.RedirectStandardOutput = true;
|
|
|
|
// startInfo.RedirectStandardError = true;
|
|
|
|
// startInfo.CreateNoWindow = true;
|
|
|
|
// return new ProcessProvider().Start(startInfo);
|
|
|
|
// }
|
2011-11-14 06:37:36 +03:00
|
|
|
|
2011-11-17 04:40:55 +03:00
|
|
|
// }
|
|
|
|
//}
|