コード例 #1
0
        public void ScaleUnitSetupNull()
        {
            var count = Substitute.For <IQueueCount>();
            var setup = new QueueConnection <object>();

            var s    = new StorageQueueAutoScaler <object>(count, setup);
            var unit = s.ScaleUnit(null);

            Assert.IsNotNull(unit);

            Assert.That(() => unit.Count(), Throws.TypeOf <ArgumentNullException>());
        }
コード例 #2
0
        public void ScaleUnit()
        {
            var count = Substitute.For<IQueueCount>();
            var setup = Substitute.For<IQueueSetup<object>>();
            setup.Name.Returns(Guid.NewGuid().ToString());
            var connection = Substitute.For<IQueueConnection<object>>();
            connection.ConnectionString.Returns(ConnectionString);
            connection.Setup.Returns(setup);

            var s = new StorageQueueAutoScaler<object>(count, connection);
            var unit = s.ScaleUnit(connection);

            Assert.IsNotNull(unit);
            Assert.AreEqual(1, unit.Count());
        }
コード例 #3
0
        public void ScaleUnit()
        {
            var count = Substitute.For <IQueueCount>();
            var setup = Substitute.For <IQueueSetup <object> >();

            setup.Name.Returns(Guid.NewGuid().ToString());
            var connection = Substitute.For <IQueueConnection <object> >();

            connection.ConnectionString.Returns(ConnectionString);
            connection.Setup.Returns(setup);

            var s    = new StorageQueueAutoScaler <object>(count, connection);
            var unit = s.ScaleUnit(connection);

            Assert.IsNotNull(unit);
            Assert.AreEqual(1, unit.Count());
        }
コード例 #4
0
        public void ScaleUnitSetupNull()
        {
            var count = Substitute.For<IQueueCount>();
            var setup = new QueueConnection<object>();

            var s = new StorageQueueAutoScaler<object>(count, setup);
            var unit = s.ScaleUnit(null);

            Assert.IsNotNull(unit);
            Assert.AreEqual(1, unit.Count());
        }