public void Should_Run_With_Defaults() { var fixture = new VirtualboxFixture(r => r.DisplayVersion()); var result = fixture.Run(); Assert.AreEqual("/Working", result.Process.WorkingDirectory.FullPath, "Failed to set default working directory"); }
public void Version_CheckArg_Works() { var version = "test"; var fixture = new VirtualboxFixture(r => version = r.Version); var result = fixture.Run(); Assert.AreEqual(string.Empty, version, "version expected to be empty"); }
public void Should_Set_Valid_DirectoryPath() { var fixture = new VirtualboxFixture(r => r.FromPath("./vm").DisplayVersion()); fixture.FileSystem.CreateDirectory("./vm"); var result = fixture.Run(); Assert.AreEqual("/Working/vm", result.Process.WorkingDirectory.FullPath, "Failed to set working directory"); }
public void DisplayVersion_CheckArg_Works() { var fixture = new VirtualboxFixture(r => r.DisplayVersion()); var result = fixture.Run(); Assert.AreEqual(1, result.Process.Arguments.Count, "only 1 argument defined"); var arg = result.Process.Arguments.First(); Assert.AreEqual("--version", arg.Render(), "failed to set version option"); }
public void ListVms_CheckArg_Ok() { var fixture = new VirtualboxFixture(r => r.ListVms()); var result = fixture.Run(); Assert.AreEqual(2, result.Process.Arguments.Count, "should only have 2 argument defined"); var args = result.Process.Arguments.ToList(); Assert.AreEqual("list", args[0].Render(), "failed to set list argument"); Assert.AreEqual("vms", args[1].Render(), "failed to set vms argument"); }
public void ShowVmInfo_CheckArg_Ok() { var id = Guid.NewGuid(); var fixture = new VirtualboxFixture(r => r.ShowVmInfo(id)); var result = fixture.Run(); Assert.AreEqual(2, result.Process.Arguments.Count, "should only have 2 argument defined"); var args = result.Process.Arguments.ToList(); Assert.AreEqual("showvminfo", args[0].Render(), "failed to set showvminfo argument"); Assert.IsTrue(id.ToString().Equals(args[1].Render(), StringComparison.InvariantCultureIgnoreCase), "failed to set UUID argument"); }
public void Should_Throw_On_NonExistent_Directory() { var fixture = new VirtualboxFixture(r => r.FromPath("./fake").DisplayVersion()); var result = fixture.Run(); }
public void RemoveVm_CheckArg_Fail() { var fixture = new VirtualboxFixture(r => r.RemoveVm(null)); var result = fixture.Run(); }