コード例 #1
0
        GivenConfigWithUpdateSteamWorkshopItemTask_WithTags__WhenParsing__TaskShouldBeConfiguredWithGivenTags()
        {
            const string lua = @"
                local p = project('test')
                local j = p:add_job('test-job')
                j:add_task(update_steam_workshop_item {
                    app_id = 32470,
                    item_id = 1234,
                    title = 'my-test-item',
                    description_file = 'path/to/description',
                    item_folder = 'path/to/folder',
                    visibility = visibility.private,
                    language = 'English',
                    tags = {'EAW', 'FOC'}
                })
            ";

            _mockFileData.TextContents = lua;

            TaskBuilderSpy taskBuilderMock = new TaskBuilderSpy();

            BuildComponentFactoryStub factoryStub = new BuildComponentFactoryStub {
                TaskBuilder = taskBuilderMock
            };

            MakeSutAndParse(factoryStub);

            object actual = taskBuilderMock["Tags"];

            Assert.IsInstanceOfType(actual, typeof(IEnumerable <string>));
            CollectionAssert.AreEquivalent(ExpectedTags, ((IEnumerable <string>)actual).ToArray());
        }
コード例 #2
0
        GivenLuaUpdateSteamWorkshopItemTaskWithConfigTable_With_Tags__OnCreation__ShouldConfigureTaskWithTags()
        {
            TaskBuilderSpy taskBuilderSpy = new TaskBuilderSpy();

            using NLua.Lua luaInterpreter = new NLua.Lua();
            LuaTable table = CreateConfigurationTableWithOnlyTags(luaInterpreter);

            LuaUpdateSteamWorkshopItemTask sut = new LuaUpdateSteamWorkshopItemTask(taskBuilderSpy, table);

            object actual = taskBuilderSpy["Tags"];

            Assert.IsInstanceOfType(actual, typeof(IEnumerable <string>));
            CollectionAssert.AreEquivalent(ExpectedTags, ((IEnumerable <string>)actual).ToArray());
        }