Esempio n. 1
0
        public void RegisterLoginInfoBLLSaveLoginedMethodTest()
        {
            //Arrange
            RegisterLoginInfoBLL registerLoginInfoBLL = new RegisterLoginInfoBLL();
            OfficeStoreContext   officeStoreContext   = new OfficeStoreContext();
            var InitialLaslLoginLoad = officeStoreContext.LastLogin.Last().Id;

            //Act
            registerLoginInfoBLL.SaveLogined("1");
            var AfterInitialLaslLoginLoad = officeStoreContext.LastLogin.Last().Id;

            //Assert
            Assert.AreEqual(InitialLaslLoginLoad + 1, InitialLaslLoginLoad + 1);
            officeStoreContext.LastLogin.Remove(officeStoreContext.LastLogin.Last());
            officeStoreContext.SaveChanges();
        }
Esempio n. 2
0
        public void RegisterLoginInfoBLLRegisterTest()
        {
            //Arrange
            RegisterLoginInfoBLL registerLoginInfoBLL = new RegisterLoginInfoBLL();
            OfficeStoreContext   officeStoreContext   = new OfficeStoreContext();
            int InitialEmployeesCount = officeStoreContext.Employees.Count();

            //Act
            registerLoginInfoBLL.Register("Barman", "Kavalov", "Sliven", "12345678");
            int AfterInitialEmployeesCount = officeStoreContext.Employees.Count();

            //Assert
            Assert.AreEqual(InitialEmployeesCount + 1, AfterInitialEmployeesCount);
            officeStoreContext.Employees.Remove(officeStoreContext.Employees.First(a => a.FirstName == "Barman"));
            officeStoreContext.SaveChanges();
        }
Esempio n. 3
0
        public void UpdateCreateSalesReportBLLIsItemExistsTest()
        {
            //Arrange
            UpdateCreateSalesReportBLL updateCreateSalesReportBLL = new UpdateCreateSalesReportBLL();
            OfficeStoreContext         officeStoreContext         = new OfficeStoreContext();

            //Act
            updateCreateSalesReportBLL.CreateItem(new Items()
            {
                Id = "12", ProductName = "bira", Status = "Factory New", OriginalPrice = 1, SalesPrice = 2, Quantity = 12
            });
            bool IsItemExists = updateCreateSalesReportBLL.IsItemExists("12");

            //Assert
            Assert.IsTrue(IsItemExists);
            officeStoreContext.Items.Remove(officeStoreContext.Items.First(a => a.ProductName == "bira"));
            officeStoreContext.SaveChanges();
        }
Esempio n. 4
0
        public void UpdateCreateSalesReportBLLTest()
        {
            //Arrange
            UpdateCreateSalesReportBLL updateCreateSalesReportBLL = new UpdateCreateSalesReportBLL();
            OfficeStoreContext         officeStoreContext         = new OfficeStoreContext();

            //Act
            var InitialItemsCount = officeStoreContext.Items.Count();

            updateCreateSalesReportBLL.CreateItem(new Items()
            {
                Id = "12", ProductName = "bira", Status = "Factory New", OriginalPrice = 1, SalesPrice = 2, Quantity = 12
            });
            var AfterInitialItemsCount = officeStoreContext.Items.Count();

            //Assert
            Assert.AreEqual(InitialItemsCount + 1, AfterInitialItemsCount);
            officeStoreContext.Items.Remove(officeStoreContext.Items.First(a => a.ProductName == "bira"));
            officeStoreContext.SaveChanges();
        }