public void GetReading_GiveId_GetReading() { // Arrange var id = 1; var reading = new Reading(); _billUnitOfWorkMock.Setup(x => x.ReadingRepository).Returns(_readingRepositoryMock.Object); _readingRepositoryMock.Setup(x => x.GetById(id)).Returns(reading); // Act _readingService.GetReading(id); //Assert _billRepositoryMock.VerifyAll(); _readingRepositoryMock.VerifyAll(); }
public void Load(int id) { var reading = _readingService.GetReading(id); if (reading != null) { Id = reading.Id; // Month = reading.Month; DayOffset = reading.DayOffset; PreviousReading = reading.PreviousReading; PresentReading = reading.PresentReading; ReadingTakenDate = reading.ReadingTakenDate; TenantId = reading.TenantId; } }