public void WhenCallingClean__ShouldReturnLuaCleanTask() { BuildComponentFactorySpy factorySpy = new BuildComponentFactorySpy(); EawCiLuaEnvironment sut = new EawCiLuaEnvironment(factorySpy, _luaParser); ILuaTask actual = sut.Clean(string.Empty); Assert.IsInstanceOfType(actual, typeof(LuaCleanTask)); }
public void WhenCallingRunProcess__ShouldCallBuildComponentFactoryWithRunProgramTaskName() { BuildComponentFactorySpy factorySpy = new BuildComponentFactorySpy(); EawCiLuaEnvironment sut = new EawCiLuaEnvironment(factorySpy, _luaParser); sut.RunProcess(string.Empty); Assert.AreSame("RunProgram", factorySpy.ActualTaskTypeName); }
public void WhenCallingClean__ShouldCallBuildComponentFactoryWithCleanTaskName() { BuildComponentFactorySpy factorySpy = new BuildComponentFactorySpy(); EawCiLuaEnvironment sut = new EawCiLuaEnvironment(factorySpy, _luaParser); sut.Clean(string.Empty); Assert.AreSame("Clean", factorySpy.ActualTaskTypeName); }
public void WhenCallingLink__ShouldCallBuildComponentFactoryWithSoftCopyTaskName() { BuildComponentFactorySpy factorySpy = new BuildComponentFactorySpy(); EawCiLuaEnvironment sut = new EawCiLuaEnvironment(factorySpy, _luaParser); sut.Link(string.Empty, string.Empty); Assert.AreSame("SoftCopy", factorySpy.ActualTaskTypeName); }
public void WhenCallingUpdateSteamWorkshopItem__ShouldReturnLuaUpdateSteamWorkshopItemTask() { BuildComponentFactorySpy factorySpy = new BuildComponentFactorySpy(); EawCiLuaEnvironment sut = new EawCiLuaEnvironment(factorySpy, _luaParser); LuaTable table = MakeLuaTable(_luaParser.Lua, "the_table"); ILuaTask actual = sut.UpdateSteamWorkshopItem(table); Assert.IsInstanceOfType(actual, typeof(LuaUpdateSteamWorkshopItemTask)); }
WhenCallingUpdateSteamWorkshopItem__ShouldCallBuildComponentFactoryWithUpdateWorkshopItemTaskName() { BuildComponentFactorySpy factorySpy = new BuildComponentFactorySpy(); EawCiLuaEnvironment sut = new EawCiLuaEnvironment(factorySpy, _luaParser); LuaTable table = MakeLuaTable(_luaParser.Lua, "the_table"); sut.UpdateSteamWorkshopItem(table); Assert.AreSame("UpdateSteamWorkshopItem", factorySpy.ActualTaskTypeName); }
public void GivenProjectWithJobAndCopyTask__WhenCallingParse__ShouldRequestTaskBuilderForCorrectType() { const string xml = @"<?xml version=""1.0"" encoding=""UTF-8""?> <eaw-ci:BuildConfiguration ConfigVersion=""1.0.0"" xmlns:eaw-ci=""eaw-ci"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""> <Projects> <Project Id=""idvalue0""> <Jobs> <Job Id=""idvalue1"" Name=""TestJob""> <Tasks> <Task Id=""idvalue2"" Name=""TestTask"" xsi:type=""eaw-ci:Copy""> <CopyFromPath>path/to/source</CopyFromPath> <CopyToPath>path/to/dest</CopyToPath> <CopySubfolders>true</CopySubfolders> <CopyFileByPattern>*</CopyFileByPattern> <AlwaysOverwrite>true</AlwaysOverwrite> </Task> </Tasks> </Job> </Jobs> </Project> </Projects> </eaw-ci:BuildConfiguration>"; _mockFileData.TextContents = xml; BuildComponentFactorySpy factorySpy = new BuildComponentFactorySpy(); XmlBuildConfigParser sut = new XmlBuildConfigParser(_fileSystem, factorySpy); sut.Parse(Path); string expected = "Copy"; Assert.AreEqual(expected, factorySpy.ActualTaskTypeName, $"Should have requested TaskBuilder for {expected}, but got {factorySpy.ActualTaskTypeName}"); }