示例#1
0
        public void CheckVendorName()
        {
            _vendorInformationService.InsertVendorInformation(_vendor1);
            _vendorInformationService.InsertVendorInformation(_vendor2);

            GetVendorInformationApiResponse response = GetVendorInformationApi.CallGetVendorInfoApi(_vendor1.Id);

            Assert.AreEqual(_vendor1.Name, response.Name, "Check vendor name");
        }
示例#2
0
        public void CheckVendorRating()
        {
            _vendorInformationService.InsertVendorInformation(_vendor1);
            _vendorInformationService.InsertVendorInformation(_vendor2);

            GetVendorInformationApiResponse response = GetVendorInformationApi.CallGetVendorInfoApi(_vendor1.Id);

            Assert.AreEqual(_vendor1.Rating, response.Rating, "Check vendor Rating");
        }
示例#3
0
        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");
        }
示例#4
0
        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");
        }
示例#5
0
        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");
            }
        }