Esempio n. 1
0
        public void Test_ProductionCalendarService_AddRecord()
        {
            RepositoryTestHelper.SetUpAdd <ProductionCalendarRecord, IProductionCalendarRepository>(_repositoryMock);

            var newRecord = new ProductionCalendarRecord
            {
                Year         = 2018,
                Month        = 3,
                Day          = 1,
                CalendarDate = new DateTime(2018, 3, 1),
                WorkingHours = 8
            };
            var svc         = new ProductionCalendarService(_repositoryFactoryMock.Object);
            var savedRecord = svc.AddRecord(newRecord);

            _repositoryMock.Verify(m => m.Add(newRecord), Times.Once());
            //Assert.That(savedRecord, Is.SameAs(newRecord));
            Assert.Same(savedRecord, newRecord);
        }