public async Task ReadAsync_given_existing_id_returns_a_hero_with_all_properties()
        {
            var batman = await _repository.ReadAsync(2);

            Assert.Equal(2, batman.Id);
            Assert.Equal("Bruce Wayne", batman.Name);
            Assert.Equal("Batman", batman.AlterEgo);
            Assert.Equal("CEO of Wayne Enterprises", batman.Occupation);
            Assert.Equal(Male, batman.Gender);
            Assert.Equal(1939, batman.FirstAppearance);
            Assert.Equal(2, batman.CityId);
            Assert.Equal("Gotham City", batman.CityName);
            Assert.True(batman.Powers.SetEquals(new[] { "exceptional martial artist", "combat strategy", "inexhaustible wealth", "brilliant deductive skills", "advanced technology" }));
        }
Esempio n. 2
0
        public async Task ReadAsync_given_existing_id_returns_a_hero_with_all_properties()
        {
            var batman = await _repository.ReadAsync(2);

            Assert.Equal(2, batman.Id);
            Assert.Equal("Bruce Wayne", batman.Name);
            Assert.Equal("Batman", batman.AlterEgo);
            Assert.Equal("CEO of Wayne Enterprises", batman.Occupation);
            Assert.Equal(Shared.Gender.Male, batman.Gender);
            Assert.Equal(1939, batman.FirstAppearance);
            Assert.Equal(2, batman.CityId);
            Assert.Equal("Gotham City", batman.CityName);
            Assert.Equal("https://ondfisk.blob.core.windows.net/superheroes/batman-portrait.jpg", batman.PortraitUrl);
            Assert.Equal("https://ondfisk.blob.core.windows.net/superheroes/batman-background.jpg", batman.BackgroundUrl);
            Assert.True(batman.Powers.ToHashSet().SetEquals(new[] { "exceptional martial artist", "combat strategy", "inexhaustible wealth", "brilliant deductive skills", "advanced technology" }));
        }