public void AddStore_1()
        {
            int ExpectedOutput = 1;
            int GotOutput      = 0;
            CRUDTemplate <IStores> StoresTemplateObj = new StoresTemplate();
            Stores StoresObj = new Stores();

            StoresObj.SetStoreName("Test_Store");
            StoresObj.SetStoreLogo("images\test.png");
            try
            {
                GotOutput = StoresTemplateObj.Insert(StoresObj);
            }
            catch (Exception)
            {
                GotOutput = -2;
            }
            Assert.AreEqual(ExpectedOutput, GotOutput);
            // Deleting newely added Store
            List <IStores> Output = StoresTemplateObj.Select();

            foreach (Stores Store in Output)
            {
                if ("Test_Store" == Store.GetStoreName())
                {
                    int StoreID = Store.GetStoreID();
                    StoresObj.SetStoreID(StoreID);
                    break;
                }
            }
            StoresTemplateObj.Delete(StoresObj);
        }
        public void ModifyStore_1()
        {
            int ExpectedOutput = 1;
            int GotOutput      = 0;
            CRUDTemplate <IStores> StoresTemplateObj = new StoresTemplate();
            Stores StoresObj = new Stores();

            StoresObj.SetStoreID(7);
            StoresObj.SetStoreName("Walmart_Test");
            StoresObj.SetStoreLogo("images\\walmart_test.png");
            try
            {
                GotOutput = StoresTemplateObj.Update(StoresObj);
            }
            catch (Exception)
            {
                GotOutput = -2;
            }
            Assert.AreEqual(ExpectedOutput, GotOutput);
            // Modfying Store to its original values
            StoresObj.SetStoreID(7);
            StoresObj.SetStoreName("Walmart");
            StoresObj.SetStoreLogo("images\\walmart.png");
            StoresTemplateObj.Update(StoresObj);
        }
        public void FetchStoreTest_1()
        {
            CRUDTemplate <IStores> StoresObj = new StoresTemplate();
            List <IStores>         Output    = StoresObj.Select();

            Assert.AreEqual(Output.Count > 0, true);
        }
        public void RemoveStore_3()
        {
            int ExpectedOutput = 0;
            int GotOutput      = -1;
            CRUDTemplate <IStores> StoresTemplateObj = new StoresTemplate();
            Stores StoresObj = new Stores();

            StoresObj.SetStoreID(100);
            try
            {
                GotOutput = StoresTemplateObj.Delete(StoresObj);
            }
            catch (Exception)
            {
                GotOutput = -2;
            }
            Assert.AreEqual(ExpectedOutput, GotOutput);
        }
        public void AddStore_4()
        {
            int ExpectedOutput = -2;
            int GotOutput      = 0;
            CRUDTemplate <IStores> StoresTemplateObj = new StoresTemplate();
            Stores StoresObj = new Stores();

            StoresObj.SetStoreName("Test_Store");
            StoresObj.SetStoreLogo(null);
            try
            {
                GotOutput = StoresTemplateObj.Insert(StoresObj);
            }
            catch (Exception)
            {
                GotOutput = -2;
            }
            Assert.AreEqual(ExpectedOutput, GotOutput);
        }
        public void ModifyStore_4()
        {
            int ExpectedOutput = -2;
            int GotOutput      = -1;
            CRUDTemplate <IStores> StoresTemplateObj = new StoresTemplate();
            Stores StoresObj = new Stores();

            StoresObj.SetStoreID(7);
            StoresObj.SetStoreName(null);
            StoresObj.SetStoreLogo("images\\walmart_test.png");
            try
            {
                GotOutput = StoresTemplateObj.Update(StoresObj);
            }
            catch (Exception)
            {
                GotOutput = -2;
            }
            Assert.AreEqual(ExpectedOutput, GotOutput);
        }
        public void RemoveStore_1()
        {
            int ExpectedOutput = 1;
            int GotOutput      = 0;
            CRUDTemplate <IStores> StoresTemplateObj = new StoresTemplate();
            Stores StoresObj = new Stores();

            StoresObj.SetStoreName("Test_Store");
            StoresObj.SetStoreLogo("images\test.png");
            StoresTemplateObj.Insert(StoresObj);
            List <IStores> Output = StoresTemplateObj.Select();

            foreach (Stores Store in Output)
            {
                if ("Test_Store" == Store.GetStoreName())
                {
                    int StoreID = Store.GetStoreID();
                    StoresObj.SetStoreID(StoreID);
                    break;
                }
            }
            GotOutput = StoresTemplateObj.Delete(StoresObj);
            Assert.AreEqual(ExpectedOutput, GotOutput);
        }