Exemplo n.º 1
0
        public void ShouldReturnSameInstanceOnSecondGetInvoke()
        {
            //Arrange
            var objectList = new TestDbObjectList <int, Guid>(x => Guid.NewGuid());

            var expectedGuid = objectList.Get(1);

            //Act
            var guid = objectList.Get(1);


            //Assert
            Assert.Equal(expectedGuid, guid);
        }
        public TestEnvironmentObject(TestEnvironmentCreateContext createContext, ITestMocks mocks)
        {
            _productsTable = createContext.Products;

            ElementInfos = new TestDbObjectList <string, ElementInfo>(
                k =>
            {
                var p = Products.Get(k);
                return(new ElementInfo(p.Info, ItemId.New(), 1));
            });

            //Prices = new Dictionary<string, ElementPrice>();

            SalesOrderEntities = createContext.Documents.SalesOrderEntities;

            DocumentFactories = new DocumentFactoryProvider(this);

            Products = new ProductsProvider(createContext.Products);

            Mocks = mocks;
        }