public void Details_WithNotExistingId_ShouldReturnNull() { // Arrange StarStuffDbContext db = this.Database; TelescopeService telescopeService = new TelescopeService(db); const int telescopeId = 1; // Act TelescopeDetailsServiceModel result = telescopeService.Details(telescopeId); // Assert Assert.Null(result); }
public void Details_WithExistingId_ShouldReturnTelescope() { // Arrange StarStuffDbContext db = this.Database; TelescopeService telescopeService = new TelescopeService(db); this.SeedDatabase(db); const int telescopeId = 1; Telescope expected = this.GetFakeTelescopes().FirstOrDefault(t => t.Id == telescopeId); // Act TelescopeDetailsServiceModel actual = telescopeService.Details(telescopeId); // Assert this.CompareTelescopes(expected, actual); }