|
using System;
using System.Diagnostics;
using System.Runtime.Serialization;
using Vts.UnitTest;
using Interfaces;
namespace ClientTests
{
[TestFixture, ProcessTest]
public class ProcessStartStopTests
{
protected Process p;
ITest test;
[Test, Sequence(0)]
public void StartProcess()
{
p = new Process();
p.StartInfo.FileName = @"..\..\..\Server\bin\debug\Server.exe";
p.StartInfo.WorkingDirectory = @"..\..\..\Server\bin\debug";
p.Start();
}
[Test, Sequence(1)]
public void CreateObject()
{
RemotingHelper.LoadConfiguration("clientConfig.xml");
test = RemotingHelper.CreateSingletonTestObject();
test.Value1 = 1;
}
[Test, Sequence(2)]
public void KillProcess()
{
RemotingHelper.UnloadConfiguration();
p.Kill();
}
[Test, Sequence(3)]
[ExpectedException(typeof(System.Net.WebException))]
public void TestObjectOnDeadProcess()
{
test.Value1 = 1;
}
[Test, Sequence(4)]
public void ReInitializeObjectsTest()
{
p = new Process();
p.StartInfo.FileName = @"..\..\..\Server\bin\debug\Server.exe";
p.StartInfo.WorkingDirectory = @"..\..\..\Server\bin\debug";
p.Start();
RemotingHelper.LoadConfiguration("clientConfig.xml");
test = RemotingHelper.CreateSingletonTestObject();
RemotingHelper.UnloadConfiguration();
// cleanup
p.Kill();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here