Exemplo n.º 1
0
        public void GetByNameShouldBeReturnValue()
        {
            //arrange
            IRepository <MainTask> repository = new MainTaskRepository();

            //act
            var result = repository.GetByName("plyaing");

            //assert
            Assert.IsNotNull(result);
        }
Exemplo n.º 2
0
        public void UpdateShouldUpdateDatabaseEntity()
        {
            //Arrange
            IRepository <MainTask> mainTaskRepository = new MainTaskRepository();
            IRepository <User>     userRepository     = new UserRepository();
            //Act
            User     user     = userRepository.GetById(1);
            MainTask mainTask = new MainTask
            {
                Name      = "study",
                Date      = DateTime.Parse(DateTime.Now.Date.ToShortDateString()),
                StartTime = DateTime.Parse(DateTime.Now.ToShortTimeString()),
                EndTime   = DateTime.Parse(DateTime.Today.ToShortTimeString()),
                Priority  = PriorityType.LOW,
                User      = user
            };

            mainTaskRepository.Update(mainTask, 1);
            var mainTaskByName = mainTaskRepository.GetByName("study");

            //Assert
            Assert.IsNotNull(mainTaskByName);
        }