Esempio n. 1
0
        public void ScheduleActionCorrectlyUpdatesRepositories()
        {
            // Arrange
            var scheduleItems = new List <ScheduleItem>();

            scheduleItems.Add(new ScheduleItem {
                ServiceTicketID = 1
            });
            //mockScheduleItemRepo.SetReturnValue("get_All", scheduleItems.AsQueryable<ScheduleItem>());

            ServiceTicket ticket = new ServiceTicket {
                ID = 0
            };

            mockServiceTicketRepo.Find(Arg.Any <int>()).Returns(ticket);

            // Act
            controller.AssignSchedule(1, 101, 0);

            // Assert
            Assert.Equal(101, ticket.AssignedToID);
            mockScheduleItemRepo.Received().Save();
            mockServiceTicketRepo.Received().Save();
        }