We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There are two issues in our tests:
Issue # 1: The dependencies are verified twice like this:
[Fact] public async Task ShouldRetrieveCalendarByIdAsync() { // given Guid randomCalendarId = Guid.NewGuid(); Guid inputCalendarId = randomCalendarId; DateTimeOffset randomDateTime = GetRandomDateTime(); Calendar randomCalendar = CreateRandomCalendar(randomDateTime); Calendar storageCalendar = randomCalendar; Calendar expectedCalendar = storageCalendar; this.storageBrokerMock.Setup(broker => broker.SelectCalendarByIdAsync(inputCalendarId)) .ReturnsAsync(storageCalendar); // when Calendar actualCalendar = await this.calendarService.RetrieveCalendarByIdAsync(inputCalendarId); // then actualCalendar.Should().BeEquivalentTo(expectedCalendar); this.dateTimeBrokerMock.Verify(broker => broker.GetCurrentDateTime(), Times.Never); this.storageBrokerMock.Verify(broker => broker.SelectCalendarByIdAsync(inputCalendarId), Times.Once); this.dateTimeBrokerMock.VerifyNoOtherCalls(); this.storageBrokerMock.VerifyNoOtherCalls(); this.storageBrokerMock.VerifyNoOtherCalls(); }
The solution in this case is the last three lines should be as follows:
this.dateTimeBrokerMock.VerifyNoOtherCalls(); this.storageBrokerMock.VerifyNoOtherCalls(); this.dateTimeBroker.VerifyNoOtherCalls();
Issue # 2: The dependencies are not verified at all:
[Fact] public void ShouldRetrieveAllCalendars() { // given IQueryable<Calendar> randomCalendars = CreateRandomCalendars(); IQueryable<Calendar> storageCalendars = randomCalendars; IQueryable<Calendar> expectedCalendars = storageCalendars; this.storageBrokerMock.Setup(broker => broker.SelectAllCalendars()) .Returns(storageCalendars); // when IQueryable<Calendar> actualCalendars = this.calendarService.RetrieveAllCalendars(); // then actualCalendars.Should().BeEquivalentTo(expectedCalendars); this.storageBrokerMock.Verify(broker => broker.SelectAllCalendars(), Times.Once); this.storageBrokerMock.VerifyNoOtherCalls(); this.loggingBrokerMock.VerifyNoOtherCalls(); }
The solution for this one would be as follows:
This issue is assigned to @Bbereket1
The text was updated successfully, but these errors were encountered:
@Noahmahi2019 is assigned here.
Sorry, something went wrong.
No branches or pull requests
There are two issues in our tests:
Issue # 1:
The dependencies are verified twice like this:
The solution in this case is the last three lines should be as follows:
Issue # 2:
The dependencies are not verified at all:
The solution for this one would be as follows:
This issue is assigned to @Bbereket1
The text was updated successfully, but these errors were encountered: