예제 #1
0
        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");
        }
예제 #2
0
 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
     };
 }
예제 #3
0
        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();
        }
예제 #4
0
        public void AmazonListingService_GetAmazonListingModel_ShouldReturnAmazonListingModelTypeSecondMethod()
        {
            var model = new AmazonListingModel();

            var results = _amazonListingService.GetAmazonListingModel(model);

            results.Should().BeOfType<AmazonListingModel>();
        }