Example #1
0
        public void DeletingTransport()
        {
            var UoW = new Mock <UnitOfWork>();

            UoW.Object.DeleteDB();

            var TransportLogic = new TransportLogic(UoW.Object);
            var UserLogic      = new UserLogic(UoW.Object);

            UserLogic.AddUser(new BLL.DTOs.UserDTO("Liza", BLL.DTOs.UserType.Manager, "Bril", "Login", "Password"));
            UserLogic.Login("Login", "Password");

            TransportLogic.AddTransport(new BLL.DTOs.TransportDTO("Bus", "Kyiv", DateTimeOffset.Parse("22.10.18 11:15"), "Krakow", DateTimeOffset.Parse("22.10.18 23:45")), 30, 150);
            var Transport = TransportLogic.GetAllTransport().ToList()[0];

            Assert.That(TransportLogic.GetAllTransport().Count() == 1);

            TransportLogic.DeleteTransport(1);

            Assert.That(TransportLogic.GetAllTransport().Count() == 0);
        }
        public void DeletingTransport()
        {
            var UoW = new Mock <UnitOfWork>();

            UoW.Object.DeleteDB();

            var TransportLogic = new TransportLogic(UoW.Object);
            var UserLogic      = new UserLogic(UoW.Object);

            UserLogic.AddUser(new Logic.DTOs.UserDTO("Sasha", Logic.DTOs.UserType.Manager, "Veklych", "Login", "Password"));
            UserLogic.Login("Login", "Password");

            TransportLogic.AddTransport(new Logic.DTOs.TransportDTO("Bus", "Kyiv", DateTimeOffset.Parse("21.12.15 21:15"), "Hust", DateTimeOffset.Parse("22.12.15 9:15")), 30, 150);

            var Transport = TransportLogic.GetAllTransport().ToList()[0];

            Assert.That(TransportLogic.GetAllTransport().Count() == 1);

            TransportLogic.DeleteTransport(1);

            Assert.That(TransportLogic.GetAllTransport().Count() == 0);
        }