コード例 #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);
        }