Esempio n. 1
0
        public Task WithoutResponseBodyInformationServerWillSendConnectionCloseAndDisconnect()
        {
            App.OptionCallResultImmediately = true;

            Connection.Execute();

            return(Socket.AddAsync(
                       @"GET / HTTP/1.1
Host: localhost

GET /ignored HTTP/1.1
Host: localhost

"
                       ).Then(() =>
            {
                Assert.True(Socket.DisconnectCalled);
                Assert.Equal(1, App.CallCount);
                Assert.Equal(
                    @"HTTP/1.1 200 OK
Connection: close

", Socket.Output);
            }));
        }
Esempio n. 2
0
        public Task ConnectionClassCanBeTested()
        {
            App.OptionCallResultImmediately = false;

            Assert.Equal(false, Socket.ReceiveAsyncPaused);

            Connection.Execute();

            Assert.Equal(true, Socket.ReceiveAsyncPaused);

            return(Socket.AddAsync(
                       @"GET / HTTP/1.1
Host: localhost
Connection: close

").Then(() => Socket.ReceiveAsyncPaused.ShouldBe(false)));
        }