public void GetOrCreate_SameProcessName_Should_Same() { var simpleProcessFactory = new SimpleProcessFactory(); var simpleProcess = simpleProcessFactory.GetOrCreate(new SimpleProcessInfo() { ProcessName = "Foo", ExePath = "Foo.exe" }); var simpleProcess2 = simpleProcessFactory.GetOrCreate(new SimpleProcessInfo() { ProcessName = "Foo", ExePath = "Foo.exe" }); simpleProcess2.ShouldSame(simpleProcess); }
public void Create_GetOrCreate_ArgsNull_Should_Ex() { AssertHelper.ShouldThrows <ArgumentNullException>(() => { var simpleProcessFactory = new SimpleProcessFactory(); simpleProcessFactory.Create(null); }); AssertHelper.ShouldThrows <ArgumentNullException>(() => { var simpleProcessFactory = new SimpleProcessFactory(); simpleProcessFactory.GetOrCreate(null); }); }
public void Create_GetOrCreate_ExePathNull_Should_Ex() { AssertHelper.ShouldThrows <ArgumentException>(() => { var simpleProcessFactory = new SimpleProcessFactory(); simpleProcessFactory.Create(new SimpleProcessInfo() { ProcessName = "Foo", ExePath = "" }); }); AssertHelper.ShouldThrows <ArgumentException>(() => { var simpleProcessFactory = new SimpleProcessFactory(); simpleProcessFactory.GetOrCreate(new SimpleProcessInfo() { ProcessName = "Foo", ExePath = "" }); }); }