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

            this.SeedDatabase(db);

            // Act
            PlanetFormServiceModel actual = planetService.GetForm(11);

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

            this.SeedDatabase(db);
            Planet expected = this.GetFakePlanets().First();

            // Act
            PlanetFormServiceModel actual = planetService.GetForm(expected.Id);

            // Assert
            this.ComparePlanets(expected, actual);
        }