예제 #1
0
        public void DlcDataMapping()
        {
            var mapper = new GameMapperConfig();
            var dlc    = SetupFakeDlc();

            var dataModel = mapper.Map <DlcDataModel>(dlc);

            dataModel.Name.Should().Be("Test Dlc Name");
            dataModel.Author.Should().Be("Test Dlc Author");
            dataModel.Description.Should().Be("Test Dlc Description");
        }
예제 #2
0
        public void GameDataListMapping()
        {
            var mapper = new GameMapperConfig();
            var game   = SetupFakeGame();
            var data   = new List <Game> {
                game
            };

            var list = mapper.Map <List <GameDataModel> >(data);

            list.Should().HaveCount(data.Count);
            list[0].Name.Should().Be(data[0].MetaData.Name);
            list[0].StartupLine.Should().Be(data[0].StartupLine);
        }
예제 #3
0
        public void GameDataMapping()
        {
            var mapper = new GameMapperConfig();
            var game   = SetupFakeGame();

            var dataModel = mapper.Map <GameDataModel>(game);

            dataModel.Id.Should().Be(game.Id);
            dataModel.Author.Should().Be("Test Author");
            dataModel.Name.Should().Be("Test Name");
            dataModel.Description.Should().Be("Test Description");
            dataModel.Slug.Should().Be("test-slug");
            dataModel.StoreUrl.Should().Be("http://teststoreurl");
            dataModel.SupportUrl.Should().Be("http://testsupporturl");
            dataModel.ReleasedOn.Should().Be(new DateTime(2008, 1, 2));

            dataModel.Directory.Should().Be("C:\\temp\\some game");
            dataModel.Executable.Should().Be("C:\\temp\\some game\\game.exe");
            dataModel.StartupLine.Should().Be("\"C:\\temp\\some game\\game.exe\" -mod= -startupswitch");
            dataModel.IsInstalled.Should().BeTrue();
            dataModel.Version.Should().Be(new Version(1, 1, 1));

            dataModel.Dlcs.Should().HaveCount(game.Dlcs.Count());
        }