public async Task When_GettingStandardOptionsByStandardId_AndIdIsStandardUId_Then_ReturnsStandardOptions(StandardOptions option)
        {
            var standardUId = "ST0023_1.0";

            _mockStandardRepository.Setup(s => s.GetStandardOptionsByStandardUId(standardUId)).ReturnsAsync(option);

            var result = await _standardService.GetStandardOptionsByStandardId(standardUId);

            result.Should().BeEquivalentTo(option);
        }
예제 #2
0
        public async Task When_GettingStandardOptionsByStandardId_And_OuterApiReturnsStandardDetailResponse_Then_ReturnsStandardOptions(StandardDetailResponse response, string id)
        {
            _mockOuterApiClient.Setup(client => client.Get <StandardDetailResponse>(It.Is <GetStandardByIdRequest>(x => x.Id == id)))
            .ReturnsAsync(response);

            var result = await _standardService.GetStandardOptionsByStandardId(id);

            Assert.IsInstanceOf <StandardOptions>(result);
            Assert.AreEqual(result.CourseOption, response.Options);
            Assert.AreEqual(result.StandardUId, response.StandardUId);
            Assert.AreEqual(result.StandardCode, response.LarsCode);
            Assert.AreEqual(result.StandardReference, response.IfateReferenceNumber);
            Assert.AreEqual(result.Version, response.Version.ToString("#.0"));
        }