public void ListingController_AddManyPOST_ShouldRedirectToSyncManyIfValuesProvided() { var model = new AmazonListingModel() { ChosenProductVariants = "P1", AmazonListingGroup = new AmazonListingGroup() }; var result = _listingController.AddMany_POST(model); result.As<RedirectToRouteResult>().RouteValues["action"].Should().Be("SyncMany"); }
public AmazonListingModel GetAmazonListingModel(AmazonListingModel oldModel) { return new AmazonListingModel() { AmazonListingGroup = oldModel.AmazonListingGroup, ProductVariants = _productVariantService.GetAllVariants(oldModel.Name, oldModel.CategoryId, oldModel.Page), CategoryId = oldModel.CategoryId, Categories = _optionService.GetCategoryOptions(), Page = oldModel.Page }; }
public void ListingController_AddManyPOST_ShouldCallInitAmazonListingsFromProductVariants() { var model = new AmazonListingModel() { ChosenProductVariants = "P1", AmazonListingGroup = new AmazonListingGroup() }; var result = _listingController.AddMany_POST(model); A.CallTo(() => _prepareForSyncAmazonListingService.InitAmazonListingsFromProductVariants(model.AmazonListingGroup, model.ChosenProductVariants)).MustHaveHappened(); }
public void AmazonListingService_GetAmazonListingModel_ShouldReturnAmazonListingModelTypeSecondMethod() { var model = new AmazonListingModel(); var results = _amazonListingService.GetAmazonListingModel(model); results.Should().BeOfType<AmazonListingModel>(); }