Пример #1
0
        public DictionaryProducts()
        {
            var filePath = ProductsProvider.GetDbPath();
            var obj      = new ProductsProvider(filePath);

            DictionaryOfProducts = obj.GetAllProductsFromDb();
        }
Пример #2
0
        public void CheckDatabaseFilePath()
        {
            var filePath         = ProductsProvider.GetDbPath();
            var fileExistsInPath = File.Exists(filePath);

            Assert.True(fileExistsInPath.Equals(true));
        }
Пример #3
0
        public void WhenCorrectAddressIsPassedThenCreateDbObject()
        {
            var filePath         = ProductsProvider.GetDbPath();
            var productsProvider = new ProductsProvider(filePath);

            Assert.False(productsProvider.DbConnection.Equals(null));
        }
Пример #4
0
        public void WhenCorrectDatabaseFilePathPassedCreateProductObject()
        {
            var filePath         = ProductsProvider.GetDbPath();
            var productsProvider = new ProductsProvider(filePath);

            Assert.True(!productsProvider.Equals(null));
        }
Пример #5
0
        public void GetAllProductsFromDatabaseWhenCorrectFilePathIsPassed()
        {
            var filePath    = ProductsProvider.GetDbPath();
            var products    = new ProductsProvider(filePath);
            var allProducts = products.GetAllProductsFromDb();

            Assert.True(allProducts.Count != 0);
        }