public async Task<byte[]> Get(Guid sessionId, Guid countryId, Guid patientId) { var reportIdentity = new ReportIdentity { SessionId = sessionId, CountryId = countryId, PatientId = patientId }; return await _report.Get(reportIdentity); }
public async Task Get_returns_the_report() { var summaryReport = Substitute.For<ISummaryReport>(); var sut = new SummaryReportController(summaryReport); var reportIdentity = new ReportIdentity { SessionId = Guid.NewGuid(), PatientId = Guid.NewGuid(), CountryId = Guid.NewGuid() }; var expected = Encoding.UTF8.GetBytes(reportIdentity.ToString()); summaryReport.Get(Arg.Any<ReportIdentity>()).Returns(expected); var actual = await sut.Get(reportIdentity.SessionId, reportIdentity.CountryId, reportIdentity.PatientId); Assert.Equal(expected, actual); }