public static MockStorage AutoBodyBy(MockStorage ms) { { var m = PEnvironment.GetCommandLineArgs().BodyBy(ms); m.Setup(_ => _()).Returns(new[] { Guid.NewGuid().ToString() }); ms.Set(PEnvironment.GetCommandLineArgs, m); } { var m = PEnvironment.CurrentDirectoryGet().BodyBy(ms); m.Setup(_ => _()).Returns(Guid.NewGuid().ToString()); ms.Set(PEnvironment.CurrentDirectoryGet, m); } return ms; }
public static MockStorage AutoBodyBy(this PProxyProcessModule procMod, MockStorage ms) { procMod.ModuleNameGet().Body = @this => Guid.NewGuid().ToString(); // to avoid NullReferenceException that is caused in Moq. { var m = procMod.FileNameGet().BodyBy(ms); m.Setup(_ => _(It.IsAny <ProcessModule>())).Returns(Guid.NewGuid().ToString()); ms.Set(procMod.FileNameGet, m); } return(ms); }
public static MockStorage AutoBodyBy(MockStorage ms) { { var m = PProcess.GetCurrentProcess().BodyBy(ms); m.Setup(_ => _()).Returns(new PProxyProcess()); ms.Set(PProcess.GetCurrentProcess, m); } { var m = PProcess.StartProcessStartInfo().BodyBy(ms); m.Setup(_ => _(It.IsAny<ProcessStartInfo>())).Returns(new PProxyProcess()); ms.Set(PProcess.StartProcessStartInfo, m); } return ms; }
public static MockStorage AutoBodyBy(MockStorage ms) { { var m = PEnvironment.GetCommandLineArgs().BodyBy(ms); m.Setup(_ => _()).Returns(new[] { Guid.NewGuid().ToString() }); ms.Set(PEnvironment.GetCommandLineArgs, m); } { var m = PEnvironment.CurrentDirectoryGet().BodyBy(ms); m.Setup(_ => _()).Returns(Guid.NewGuid().ToString()); ms.Set(PEnvironment.CurrentDirectoryGet, m); } return(ms); }
public static MockStorage AutoBodyBy(this PProxyProcess proc, MockStorage ms) { { var m = proc.StartInfoGet().BodyBy(ms); m.Setup(_ => _(It.IsAny <Process>())).Returns(new ProcessStartInfo()); ms.Set(proc.StartInfoGet, m); } { var m = proc.MainModuleGet().BodyBy(ms); m.Setup(_ => _(It.IsAny <Process>())).Returns(new PProxyProcessModule()); ms.Set(proc.MainModuleGet, m); } { var m = proc.CloseMainWindow().BodyBy(ms); m.Setup(_ => _(It.IsAny <Process>())).Returns(true); ms.Set(proc.CloseMainWindow, m); } return(ms); }
public static MockStorage AutoBodyBy(MockStorage ms) { { var m = PProcess.GetCurrentProcess().BodyBy(ms); m.Setup(_ => _()).Returns(new PProxyProcess()); ms.Set(PProcess.GetCurrentProcess, m); } { var m = PProcess.StartProcessStartInfo().BodyBy(ms); m.Setup(_ => _(It.IsAny <ProcessStartInfo>())).Returns(new PProxyProcess()); ms.Set(PProcess.StartProcessStartInfo, m); } return(ms); }