Skip to content

Commit

Permalink
#44 Sada svi testovi za funkcionalnost prolaze
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarkoovin21 committed Jun 14, 2024
1 parent eb89622 commit f88b73f
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ public F14_unitTest()
public void MembershipExpieringSoon_GivenMembershipExpiresIn5days_ReturnDaysUntilexpiration()
{
// Arrange
string username = "username";
LoggedUser.Username = "username";
LoggedUser.LibraryId = 1;
DateTime? expirationDate = DateTime.Today.AddDays(5);
A.CallTo(() => membersRepository.GetMembershipDate(username)).Returns(expirationDate);
A.CallTo(() => membersRepository.GetMembershipDate(LoggedUser.Username)).Returns(expirationDate);
A.CallTo(() => libraryRepository.GetLibraryMembershipDuration(LoggedUser.LibraryId)).Returns(DateTime.Today.AddDays(5));

// Act
var daysUntilExpiration = memberService.MembershipExpieringSoon();
Expand All @@ -45,6 +47,7 @@ public void MembershipExpieringSoon_GivenMembershipExpiresIn5days_ReturnDaysUnti
Assert.Equal(5, daysUntilExpiration);
}


[Fact]

public void MembershipExpieringSoon_GivenInvalidUsername_EqualsNull()
Expand Down

0 comments on commit f88b73f

Please sign in to comment.