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>()); }
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()); }
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()); }
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()); }