Exemplo n.º 1
0
        public void UseJsonRpcServices()
        {
            var builderMock = new Mock <IApplicationBuilder>(MockBehavior.Strict);

            builderMock.Setup(o => o.New())
            .Returns(builderMock.Object);
            builderMock.Setup(o => o.Use(It.IsNotNull <Func <RequestDelegate, RequestDelegate> >()))
            .Returns(builderMock.Object);
            builderMock.Setup(o => o.Build())
            .Returns(c => Task.CompletedTask);

            JsonRpcBuilderExtensions.UseJsonRpcServices(builderMock.Object);
        }
Exemplo n.º 2
0
 public void UseJsonRpcServicesWhenBuilderIsNull()
 {
     Assert.ThrowsException <ArgumentNullException>(() =>
                                                    JsonRpcBuilderExtensions.UseJsonRpcServices(null));
 }