예제 #1
0
        public void SqrtRequest_CorrectlyReturnsOperationname()
        {
            var expected = "sqrt";
            var request  = new SqrtRequest();

            var operationName = request.GetOperationName();

            operationName.Should().Be(expected);
        }
예제 #2
0
        public async Task Sqrt_WithTrackingId_TracksOperation()
        {
            var request = new SqrtRequest();
            var trackId = "Sqrt_WithTrackingId_TracksOperation";
            var client  = _factory.CreateClient()
                          .WithTrackIdHeader(trackId);

            await client.PostJsonAsync("/calculator/sqrt", request);

            using (new AssertionScope())
            {
                _factory.Journal.TryGetValue(trackId, out ICollection <JournalOperation> journalOperations)
                .Should().BeTrue();
                journalOperations.Should().ContainSingle()
                .Which.Operation.Should().Be(request.GetOperationName());
            }
        }