Ejemplo n.º 1
0
        public async Task GetEntityAsync_NoCharacterWithGivenId_NullIsReturned()
        {
            var options = new OptionsWrapper <ConnectionOptions>(new ConnectionOptions()
            {
                ConnectionString = DbFixture.ConnectionString
            });
            var repo = new CharacterRepository(options);

            var character = await repo.GetEntityAsync(9001);

            Assert.Null(character);
        }
Ejemplo n.º 2
0
        public async Task GetEntityAsync_CharacterWithGivenId_ThatCharacterIsReturned()
        {
            var options = new OptionsWrapper <ConnectionOptions>(new ConnectionOptions()
            {
                ConnectionString = DbFixture.ConnectionString
            });
            var repo = new CharacterRepository(options);

            var character = await repo.GetEntityAsync(148);

            Assert.NotNull(character);
            Assert.Equal(148, character.Id);
            Assert.Equal("Arya Stark", character.Name);
            Assert.Equal("Northmen", character.Culture);
            Assert.True(!string.IsNullOrEmpty(character.Born));
            Assert.True(string.IsNullOrEmpty(character.Died));
            Assert.True(character.IsFemale);
            Assert.NotEmpty(character.ParseAliases());
            Assert.NotEmpty(character.ParseTitles());
            Assert.NotEmpty(character.ParseTvSeries());
            Assert.NotEmpty(character.ParsePlayedBy());
        }