Example #1
0
        public void GetName_WithNotExistingId_ShouldReturnNull()
        {
            // Arrange
            StarStuffDbContext db            = this.Database;
            PlanetService      planetService = new PlanetService(db);

            this.SeedDatabase(db);

            // Act
            object actual = planetService.GetName(11);

            // Assert
            Assert.Null(actual);
        }
Example #2
0
        public void GetName_WithExistingId_ShouldReturnValidName()
        {
            // Arrange
            StarStuffDbContext db            = this.Database;
            PlanetService      planetService = new PlanetService(db);

            this.SeedDatabase(db);

            // Act
            Planet planet = this.GetFakePlanets().First();
            string actual = planetService.GetName(planet.Id);

            // Assert
            Assert.Equal(planet.Name, actual);
        }