コード例 #1
0
        public void BuildApiManagerTest()
        {
            var manager  = builder.BuildAPIManager();
            var manager2 = builder.BuildAPIManager();

            connectionMock.Setup(c => c.CreateModel()).Returns(new Mock <IModel>().Object);
            Assert.Equal(manager, manager2);
            connectionMock.Verify(c => c.CreateModel(), Times.Once());
            connectionMock.VerifyNoOtherCalls();
        }
コード例 #2
0
        public void CreateBuilderWithUserAndPasswordForApiTest()
        {
            var settings = new Mock <IConfiguration>();

            settings.Setup(s => s.GetSection("RABBIT_URL"))
            .Returns(GetMockConfigSection("amqp://localhost"));
            settings.Setup(s => s.GetSection("RABBIT_API_URL"))
            .Returns(GetMockConfigSection("http://*****:*****@locahost"));

            builder = new AmqpBuilder(settings.Object, loggerFactoryMock.Object, connectionFactoryMock.Object);
            var manager = builder.BuildAPIManager();

            Assert.IsType <RabbitMQApiManager>(manager);
        }