コード例 #1
0
        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));
        }
コード例 #2
0
        public void WhenCallingRunProcess__ShouldCallBuildComponentFactoryWithRunProgramTaskName()
        {
            BuildComponentFactorySpy factorySpy = new BuildComponentFactorySpy();
            EawCiLuaEnvironment      sut        = new EawCiLuaEnvironment(factorySpy, _luaParser);

            sut.RunProcess(string.Empty);

            Assert.AreSame("RunProgram", factorySpy.ActualTaskTypeName);
        }
コード例 #3
0
        public void WhenCallingClean__ShouldCallBuildComponentFactoryWithCleanTaskName()
        {
            BuildComponentFactorySpy factorySpy = new BuildComponentFactorySpy();
            EawCiLuaEnvironment      sut        = new EawCiLuaEnvironment(factorySpy, _luaParser);

            sut.Clean(string.Empty);

            Assert.AreSame("Clean", factorySpy.ActualTaskTypeName);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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));
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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}");
        }