public void CheckVendorName() { _vendorInformationService.InsertVendorInformation(_vendor1); _vendorInformationService.InsertVendorInformation(_vendor2); GetVendorInformationApiResponse response = GetVendorInformationApi.CallGetVendorInfoApi(_vendor1.Id); Assert.AreEqual(_vendor1.Name, response.Name, "Check vendor name"); }
public void CheckVendorRating() { _vendorInformationService.InsertVendorInformation(_vendor1); _vendorInformationService.InsertVendorInformation(_vendor2); GetVendorInformationApiResponse response = GetVendorInformationApi.CallGetVendorInfoApi(_vendor1.Id); Assert.AreEqual(_vendor1.Rating, response.Rating, "Check vendor Rating"); }
public void CheckResponseMessageForNotExistId() { _vendorInformationService.InsertVendorInformation(_vendor1); _vendorInformationService.InsertVendorInformation(_vendor2); Guid guid = Guid.Empty; GetVendorInformationApiResponse response = GetVendorInformationApi.CallGetVendorInfoApi(guid, HttpStatusCode.NotFound); Assert.AreEqual($"Vendor {guid} is not found", response.Message, "Server returns correct message for not existing id"); }
public void CheckVendorEmptyCategoriesList() { _vendor1.Categories = null; _vendorInformationService.InsertVendorInformation(_vendor1); _vendorInformationService.InsertVendorInformation(_vendor2); GetVendorInformationApiResponse response = GetVendorInformationApi.CallGetVendorInfoApi(_vendor1.Id); Assert.Zero(response.Categories.Count, "Check vendor categories count"); }
public void CheckVendorCategories() { _vendorInformationService.InsertVendorInformation(_vendor1); _vendorInformationService.InsertVendorInformation(_vendor2); GetVendorInformationApiResponse response = GetVendorInformationApi.CallGetVendorInfoApi(_vendor1.Id); foreach (CategoryBo category in _vendor1.Categories) { Assert.True(response.Categories.Any(x => x.Id.Equals(category.Id)), "Category exist in the list"); Assert.AreEqual(category.Name, response.Categories.Find(x => x.Id.Equals(category.Id)).Name, "Check Category Name"); } }