public async Task GetColorNotFoundResult(ICollection <CarBrand> brands) { // Arrange var query = new CarContextQueryMockBuilder().SetCarBrands(brands).CarsContextQuery; var controller = new CarBrandsQueryController(query); // Act IHttpActionResult result = await controller.GetBrand(0); // Assert result.Should().BeOfType <NotFoundResult>(); }
public async Task GetModelNotFoundResultById(ICollection <CarModel> models) { // Arrange var query = new CarContextQueryMockBuilder() .SetCarModels(models).CarsContextQuery; var controller = new CarModelsQueryController(query); // Act IHttpActionResult result = await controller.GetModel(0); // Assert result.Should().BeOfType <NotFoundResult>(); }
public async Task GetColorOkResult(ICollection <CarBrand> brands) { // Arrange var query = new CarContextQueryMockBuilder().SetCarBrands(brands).CarsContextQuery;; var controller = new CarBrandsQueryController(query); // Act IHttpActionResult result = await controller.GetBrand(1); // Assert result.Should().BeOfType <OkNegotiatedContentResult <BrandReadModel> >(); }
public async Task GetModelNotFoundResultByBrandId() { // Arrange var builder = new CarContextQueryMockBuilder(); var query = builder.CarsContextQuery; var controller = new CarModelsQueryController(query); // Act IHttpActionResult result = await controller.GetModelsByBrandId(0); // Assert result.Should().BeOfType <NotFoundResult>(); }
public async Task GetModelOkResultByBrandId(int id, CarModel[] carModels, CarBrand[] carBrands) { // Arrange var query = new CarContextQueryMockBuilder() .SetCarBrands(carBrands) .SetCarModels(carModels).CarsContextQuery; var controller = new CarModelsQueryController(query); // Act IHttpActionResult result = await controller.GetModelsByBrandId(1); // Assert result.Should().BeOfType <OkNegotiatedContentResult <IEnumerable <CarModelReadModel> > >(); }
public async Task GetModelOkResultById(ICollection <CarModel> models) { // Arrange var builder = new CarContextQueryMockBuilder() .SetCarModels(models); var query = builder.CarsContextQuery; var controller = new CarModelsQueryController(query); // Act IHttpActionResult result = await controller.GetModel(1); // Assert result.Should().BeOfType <OkNegotiatedContentResult <CarModelReadModel> >(); }