public void Constructor_Should_CreateWith_ModifiedDate() { // arrange var membership = MembershipFake.Finished().Generate(); // act var sut = new ClosedMembershipState(membership, membership.ModifiedDate.Value); // assert sut.ModifiedDate.Should().NotBeNull().And.Be(membership.ModifiedDate); }
public void Finish_Should_Change_Nothing() { // arrange var membership = MembershipFake.Finished().Generate(); var sut = membership.GetState(); // act sut.Finish(); // assert sut.ModifiedDate.Should().NotBeNull().And.Be(membership.ModifiedDate); }
public void GetDuration_FinishedMembership_Should_Return_FixedDuration() { // arrange var sut = MembershipFake.Finished().Generate(); var expectedDuration = sut.ModifiedDate.Value.Subtract(sut.CreatedDate); // act var result = sut.GetDuration(); // assert sut.Should().NotBeNull().And.BeOfType <MembershipTestProxy>(); sut.ModifiedDate.Should().NotBeNull(); result.Should().Be(expectedDuration); }
public MembershipRepositoryMockBuilder Update(Membership input = null, Membership output = null) { var result = output ?? MembershipFake.Finished().Generate(); if (input == null) { _mock.Setup(x => x.Update(It.IsAny <Membership>())).Returns(result); } else { _mock.Setup(x => x.Update(input)).Returns(result); } return(this); }