コード例 #1
0
        public StockItemRepositoryFixture()
        {
            MockStockItemService = new Mock <IStockItemService>();
            var unitOfMeasure1 = new UnitOfMeasure {
                Id = 1, Code = "kg", Description = ""
            };
            var unitOfMeasure2 = new UnitOfMeasure {
                Id = 2, Code = "g", Description = ""
            };
            var unitOfMeasure3 = new UnitOfMeasure {
                Id = 3, Code = "l", Description = ""
            };
            var unitOfMeasure4 = new UnitOfMeasure {
                Id = 4, Code = "ml", Description = ""
            };
            var unitOfMeasure5 = new UnitOfMeasure {
                Id = 5, Code = "none", Description = ""
            };

            var stockType1 = new StockType {
                Id = 1, Type = "Grocery"
            };
            var stockType2 = new StockType {
                Id = 2, Type = "Beverage"
            };
            var stockType3 = new StockType {
                Id = 3, Type = "Stationery"
            };

            StockItems = new List <StockItem>
            {
                new StockItem {
                    Id = 1, TypeId = 1, Type = stockType1, Name = "Rice", ItemUnit = 10, UnitOfMeasureId = 1, UnitOfMeasure = unitOfMeasure1
                },
                new StockItem {
                    Id = 2, TypeId = 1, Type = stockType1, Name = "Chilli Powder", ItemUnit = 250, UnitOfMeasureId = 2, UnitOfMeasure = unitOfMeasure2
                },
                new StockItem {
                    Id = 3, TypeId = 2, Type = stockType2, Name = "Water", ItemUnit = 1, UnitOfMeasureId = 3, UnitOfMeasure = unitOfMeasure3
                },
                new StockItem {
                    Id = 4, TypeId = 3, Type = stockType3, Name = "Blue Pen", ItemUnit = 1, UnitOfMeasureId = 5, UnitOfMeasure = unitOfMeasure5
                },
            };

            CollectionEnvelop = new CollectionEnvelop <StockItem>
            {
                Items        = StockItems.Where(d => d.TypeId == 1),
                ItemsPerPage = 10,
                TotalItems   = 2
            };

            CreateStockItemDto = new CreateStockItemDto
            {
                Name            = "Cream Soda",
                TypeId          = 2,
                UnitOfMeasureId = 4,
                ItemUnit        = 300
            };

            CreatedNewStockItem = new StockItem
            {
                Id              = 5,
                TypeId          = 2,
                Type            = stockType2,
                Name            = "Cream Soda",
                ItemUnit        = 300,
                UnitOfMeasureId = 4,
                UnitOfMeasure   = unitOfMeasure4
            };

            EditStockItemDto = new EditStockItemDto
            {
                TypeId          = 1,
                Name            = "Rice",
                ItemUnit        = 10,
                UnitOfMeasureId = 1,
                Description     = "10kg bag"
            };
        }
コード例 #2
0
        public SupplierRepositoryFixture()
        {
            MockSupplierService = new Mock <ISupplierService>();

            Suppliers = new List <Supplier>
            {
                new Supplier
                {
                    Id            = 1,
                    Name          = "ABC Pvt Ltd",
                    Address1      = "American Mission School Road",
                    Address2      = "Madduvil South",
                    City          = "Chavakachcheri",
                    Country       = "Sri Lanka",
                    Telephone1    = "0765554345",
                    Telephone2    = "0766554567",
                    Fax           = "",
                    Email         = "*****@*****.**",
                    ContactPerson = "James"
                },
                new Supplier
                {
                    Id            = 2,
                    Name          = "VBT Pvt Ltd",
                    Address1      = "VBT Road",
                    Address2      = "VBTt",
                    City          = "Jaffna",
                    Country       = "Sri Lanka",
                    Telephone1    = "0777113644",
                    Telephone2    = "",
                    Fax           = "",
                    Email         = "*****@*****.**",
                    ContactPerson = "James"
                }
            };

            CollectionEnvelop = new CollectionEnvelop <Supplier>
            {
                Items        = Suppliers,
                ItemsPerPage = 10,
                TotalItems   = 2,
            };

            CreateSupplierDto = new CreateSupplierDto
            {
                Name          = "Jaffna Supplier Pvt Ltd",
                Address1      = "Kandy Road",
                Address2      = "Kaithady",
                City          = "Jaffna",
                Country       = "Sri Lanka",
                Telephone1    = "+94666553456",
                Telephone2    = "+94888775678",
                Fax           = "+94666448856",
                Email         = "*****@*****.**",
                ContactPerson = "Aathavan"
            };

            CreatedNewSupplier = new Supplier
            {
                Id            = 3,
                Name          = CreateSupplierDto.Name,
                Address1      = CreateSupplierDto.Address1,
                Address2      = CreateSupplierDto.Address2,
                City          = CreateSupplierDto.City,
                Country       = CreateSupplierDto.Country,
                Telephone1    = CreateSupplierDto.Telephone1,
                Telephone2    = CreateSupplierDto.Telephone2,
                Fax           = CreateSupplierDto.Fax,
                Email         = CreateSupplierDto.Email,
                ContactPerson = CreateSupplierDto.ContactPerson
            };

            EditSupplierDto = new EditSupplierDto
            {
                Name          = "VBT Pvt Ltd",
                Address1      = "#03-46, Blk 687",
                Address2      = "Hindu College Road",
                City          = "Jaffna",
                Country       = "Sri Lanka",
                Telephone1    = "0777113644",
                Telephone2    = "0777113644",
                Fax           = "0777113644",
                Email         = "*****@*****.**",
                ContactPerson = "James"
            };
        }