public void CreateLicenseShouldAddLicenseToDbWithCurrentCreationDateTime() { timeContext.Now().Returns(new DateTime(2014, 10, 10)); sut = new SimpleDataModificator(timeContext); sut.CreateLicense(10, 11, "SomeString"); var result = reader.GetAllLicenses(); Assert.AreEqual(new DateTime(2014, 10, 10).ToString("dd MMMM yyyy"), result.FirstOrDefault().CreationDate); }
public void UpdateLicenseShouldUpdateModificationDate() { var testDate = new DateTime(2014, 11, 11); timeContext.Now().Returns(x => new DateTime(2014, 10, 10), x => testDate); sut = new SimpleDataModificator(timeContext); sut.CreateLicense(10, 11, "SomeString"); sut.UpdateLicense(10, "NewString"); var result = reader.GetAllLicenses(); Assert.AreEqual(testDate.ToString("dd MMMM yyyy"), result.FirstOrDefault().ModificationDate); }