public LocalFixture()
            {
                Fixture = CommonFixture.GetNewFixture();

                StoreItemFixture = new StoreItemFixture(new StoreItemAvailabilityFixture(CommonFixture), CommonFixture);

                ItemRepositoryMock   = new ItemRepositoryMock(Fixture);
                StoreItemFactoryMock = new StoreItemFactoryMock(Fixture);
                AvailabilityValidationServiceMock = new AvailabilityValidationServiceMock(Fixture);
            }
            public LocalFixture()
            {
                Fixture = CommonFixture.GetNewFixture();

                StoreItemFixture        = new StoreItemFixture(new StoreItemAvailabilityFixture(CommonFixture), CommonFixture);
                ShoppingListMockFixture = new ShoppingListMockFixture(CommonFixture, new ShoppingListFixture(CommonFixture));

                ShoppingListRepositoryMock = new ShoppingListRepositoryMock(Fixture);
                ItemRepositoryMock         = new ItemRepositoryMock(Fixture);
            }
예제 #3
0
        protected override (Item, IStoreItem) CreateTestObjects()
        {
            var commonFixture       = new CommonFixture();
            var availabilityFixture = new StoreItemAvailabilityFixture(commonFixture);
            var storeItemFixture    = new StoreItemFixture(availabilityFixture, commonFixture);

            var destination = storeItemFixture.CreateValid();
            var source      = GetSource(destination, commonFixture);

            return(source, destination);
        }
            private IStoreItem CreateItem(ItemCategoryId itemCategoryId, ManufacturerId manufacturerId)
            {
                var def = new StoreItemDefinition
                {
                    ItemCategoryId = itemCategoryId,
                    ManufacturerId = manufacturerId,
                    Availabilities = StoreItemAvailabilityFixture.CreateManyValid(1)
                };

                return(StoreItemFixture.CreateValid(def));
            }
            public LocalFixture()
            {
                Fixture = CommonFixture.GetNewFixture();

                StoreItemFixture     = new StoreItemFixture(new StoreItemAvailabilityFixture(CommonFixture), CommonFixture);
                StoreItemMockFixture = new StoreItemMockFixture(CommonFixture, StoreItemFixture);

                ShoppingListRepositoryMock = new ShoppingListRepositoryMock(Fixture);
                ItemRepositoryMock         = new ItemRepositoryMock(Fixture);
                TransactionGeneratorMock   = new TransactionGeneratorMock(Fixture);
            }
예제 #6
0
        public DeleteItemCategoryCommandHandlerTests()
        {
            commonFixture = new CommonFixture();
            var shoppingListFixture          = new ShoppingListFixture(commonFixture);
            var storeItemAvailabilityFixture = new StoreItemAvailabilityFixture(commonFixture);
            var storeItemFixture             = new StoreItemFixture(storeItemAvailabilityFixture, commonFixture);
            var itemCategoryFixture          = new ItemCategoryFixture(commonFixture);

            itemCategoryMockFixtur  = new ItemCategoryMockFixture(commonFixture, itemCategoryFixture);
            storeItemMockFixture    = new StoreItemMockFixture(commonFixture, storeItemFixture);
            shoppingListMockFixture = new ShoppingListMockFixture(commonFixture, shoppingListFixture);
        }
            public IStoreItem CreateNewItemForStore(StoreId storeId)
            {
                var availabilityDef = StoreItemAvailabilityDefinition.FromStoreId(storeId);
                var availability    = StoreItemAvailabilityFixture.Create(availabilityDef);

                var storeItemDef = new StoreItemDefinition
                {
                    Availabilities = availability.ToMonoList()
                };

                return(StoreItemFixture.Create(storeItemDef));
            }
            public LocalFixture()
            {
                Fixture = CommonFixture.GetNewFixture();

                ShoppingListItemFixture      = new ShoppingListItemFixture(CommonFixture);
                ShoppingListFixture          = new ShoppingListFixture(CommonFixture);
                ShoppingListMockFixture      = new ShoppingListMockFixture(CommonFixture, ShoppingListFixture);
                StoreItemAvailabilityFixture = new StoreItemAvailabilityFixture(CommonFixture);
                StoreItemFixture             = new StoreItemFixture(StoreItemAvailabilityFixture, CommonFixture);

                ShoppingListRepositoryMock       = new ShoppingListRepositoryMock(Fixture);
                AddItemToShoppingListServiceMock = new AddItemToShoppingListServiceMock(Fixture);
            }
        public ConvertAsyncTestData()
        {
            commonFixture       = new CommonFixture();
            manufaturerFixture  = new ManufacturerFixture(commonFixture);
            itemCategoryFixture = new ItemCategoryFixture(commonFixture);
            storeFixture        = new StoreFixture(commonFixture);

            storeItemAvailabilityFixture = new StoreItemAvailabilityFixture(commonFixture);
            storeItemFixture             = new StoreItemFixture(storeItemAvailabilityFixture, commonFixture);

            shoppingListFixture        = new ShoppingListFixture(commonFixture);
            shoppingListSectionFixture = new ShoppingListSectionFixture(commonFixture);
            shoppingListItemFixture    = new ShoppingListItemFixture(commonFixture);
        }
            public LocalFixture()
            {
                Fixture = CommonFixture.GetNewFixture();

                StoreItemAvailabilityFixture = new StoreItemAvailabilityFixture(CommonFixture);
                StoreItemFixture             = new StoreItemFixture(StoreItemAvailabilityFixture, CommonFixture);
                StoreSectionFixture          = new StoreSectionFixture(CommonFixture);
                StoreFixture        = new StoreFixture(CommonFixture);
                ItemCategoryFixture = new ItemCategoryFixture(CommonFixture);
                ManufacturerFixture = new ManufacturerFixture(CommonFixture);

                ItemCategoryRepositoryMock = new ItemCategoryRepositoryMock(Fixture);
                ManufacturerRepositoryMock = new ManufacturerRepositoryMock(Fixture);
            }
예제 #11
0
            public LocalFixture()
            {
                Fixture = CommonFixture.GetNewFixture();

                StoreItemFixture        = new StoreItemFixture(new StoreItemAvailabilityFixture(CommonFixture), CommonFixture);
                ShoppingListMockFixture = new ShoppingListMockFixture(CommonFixture, new ShoppingListFixture(CommonFixture));
                ItemCategoryFixture     = new ItemCategoryFixture(CommonFixture);

                ItemRepositoryMock   = new ItemRepositoryMock(Fixture);
                StoreItemFactoryMock = new StoreItemFactoryMock(Fixture);
                ItemCategoryValidationServiceMock = new ItemCategoryValidationServiceMock(Fixture);
                ManufacturerValidationServiceMock = new ManufacturerValidationServiceMock(Fixture);
                AvailabilityValidationServiceMock = new AvailabilityValidationServiceMock(Fixture);
            }
            public LocalFixture()
            {
                Fixture = CommonFixture.GetNewFixture();

                ShoppingListFixture          = new ShoppingListFixture(CommonFixture);
                ShoppingListMockFixture      = new ShoppingListMockFixture(CommonFixture, ShoppingListFixture);
                ShoppingListSectionFixture   = new ShoppingListSectionFixture(CommonFixture);
                ShoppingListItemFixture      = new ShoppingListItemFixture(CommonFixture);
                StoreItemAvailabilityFixture = new StoreItemAvailabilityFixture(CommonFixture);
                StoreItemFixture             = new StoreItemFixture(StoreItemAvailabilityFixture, CommonFixture);
                StoreSectionFixture          = new StoreSectionFixture(CommonFixture);
                StoreFixture = new StoreFixture(CommonFixture);

                ShoppingListSectionFactoryMock = new ShoppingListSectionFactoryMock(Fixture);
                StoreRepositoryMock            = new StoreRepositoryMock(Fixture);
                ItemRepositoryMock             = new ItemRepositoryMock(Fixture);
                ShoppingListItemFactoryMock    = new ShoppingListItemFactoryMock(Fixture);
            }
            public IEnumerable <IStoreItem> CreateItems(IStore store)
            {
                List <StoreItemDefinition> definitions = new List <StoreItemDefinition>();

                for (int i = 0; i < 2; i++)
                {
                    var availabilityDef = new StoreItemAvailabilityDefinition
                    {
                        StoreId          = store.Id,
                        DefaultSectionId = CommonFixture.ChooseRandom(store.Sections).Id
                    };
                    var availability = StoreItemAvailabilityFixture.Create(availabilityDef);

                    var def = new StoreItemDefinition
                    {
                        Availabilities = availability.ToMonoList()
                    };
                    definitions.Add(def);
                }

                return(StoreItemFixture.CreateMany(definitions));
            }
 public StoreItemTests()
 {
     commonFixture = new CommonFixture();
     storeItemAvailabilityFixture = new StoreItemAvailabilityFixture(commonFixture);
     storeItemFixture             = new StoreItemFixture(storeItemAvailabilityFixture, commonFixture);
 }
 public IStoreItem CreateNewItem()
 {
     return(StoreItemFixture.CreateValid());
 }