public void Wait_ThrowsAnException_WhenNamesIsNull() { ConnectionUtils.UseConnection(connection => { var exception = Assert.Throws <ArgumentNullException>(() => { var signal = new MongoSignal(connection.Signal); signal.Wait((string[])null, default(CancellationToken)); }); Assert.Equal("names", exception.ParamName); }); }
public void Wait_ThrowsAnException_WhenNameIsEmpty() { ConnectionUtils.UseConnection(connection => { var exception = Assert.Throws <ArgumentException>(() => { var signal = new MongoSignal(connection.Signal); signal.Wait(string.Empty, TimeSpan.FromSeconds(5)); }); Assert.Equal("name", exception.ParamName); }); }
public void Signal_ThrowsAnException_WhenNameIsEmpty() { ConnectionUtils.UseConnection(connection => { var exception = Assert.Throws <ArgumentException>(() => { var signal = new MongoSignal(connection.Signal); signal.Set(string.Empty); }); Assert.Equal("name", exception.ParamName); }); }
public void Wait_ThrowsAnException_WhenNamesContainsEmptyName() { ConnectionUtils.UseConnection(connection => { var exception = Assert.Throws <ArgumentException>(() => { var signal = new MongoSignal(connection.Signal); signal.Wait(new[] { "test", "" }, default(CancellationToken)); }); Assert.Equal("names", exception.ParamName); }); }
public void Signal_ShouleStore_Always() { ConnectionUtils.UseConnection(connection => { // make signal name unique to void conflict with other unit tests var name = Guid.NewGuid().ToString(); var signal = new MongoSignal(connection.Signal); signal.Set(name); var signals = connection .Signal.Count(s => s.Name == name); Assert.Equal(1, signals); }); }