Exemplo n.º 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");
        }
Exemplo n.º 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
     };
 }
Exemplo n.º 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();
        }
Exemplo n.º 4
0
        public void AmazonListingService_GetAmazonListingModel_ShouldReturnAmazonListingModelTypeSecondMethod()
        {
            var model = new AmazonListingModel();

            var results = _amazonListingService.GetAmazonListingModel(model);

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