public void ForUpdate_Sets_ModifiedById() { var modifier = new SolutionsModifier(_context.Object, _contacts.Object); var soln = Creator.GetSolution(); _context.Setup(x => x.HttpContext).Returns(Creator.GetContext()); var contactId = Guid.NewGuid().ToString(); var contact = Creator.GetContact(id: contactId); _contacts.Setup(x => x.ByEmail(It.IsAny <string>())).Returns(contact); modifier.ForUpdate(soln); soln.ModifiedById.Should().Be(contactId); }
public void ForCreate_Sets_ModifiedByOn() { var modifier = new SolutionsModifier(_context.Object, _contacts.Object); var soln = Creator.GetSolution(); soln.ModifiedOn = new DateTime(2006, 2, 20); _context.Setup(x => x.HttpContext).Returns(Creator.GetContext()); var contact = Creator.GetContact(); _contacts.Setup(x => x.ByEmail(It.IsAny <string>())).Returns(contact); modifier.ForCreate(soln); soln.ModifiedOn.Should().BeCloseTo(DateTime.UtcNow); }