Ejemplo n.º 1
0
        public AgentTests()
        {
            client = new Mock <IHttpRequestClient>();
            client.Setup(c => c.MakeRequest(It.IsAny <HttpRequestMessage>()))
            .Callback <HttpRequestMessage>(r => message = r);

            builder = TestBuilderFactory.Create("/test", client.Object);
        }
Ejemplo n.º 2
0
        public AssertionTests()
        {
            message            = new HttpResponseMessage();
            message.StatusCode = HttpStatusCode.OK;
            message.Content    = new StringContent("Hello World");
            message.Headers.Add("TestHeader", "Test");

            user = new User {
                Name = "Peter", Age = 32, Id = 1
            };

            clientMock = new Mock <IHttpRequestClient>();
            clientMock.Setup(c => c.MakeRequest(It.IsAny <HttpRequestMessage>())).Returns(() => message);

            builder = TestBuilderFactory.Create("/test", clientMock.Object);
            builder.SetMethod(HttpMethod.Get);
        }
        public void Execute_RunOnlyEnabledQueriesTypeNullDbContext_WhenSomeAreDisabled()
        {
            //  Arrange
            using var testBuilder = _testBuilderFactory.Create <NullDbContext>();
            var sut = testBuilder.Build();

            // Act
            var result = sut.Execute();

            // Assert
            Assert.Equal(2, result);
        }