public void SetEmptyCallSetError() { var input = new Mock <IStormInput <object> >(MockBehavior.Strict); input.Setup(i => i.SetError(It.IsAny <StormToken>(), Storm.Error.EmptyContent)); StormExtensions.SetEmpty(input.Object); }
public void SetErrorThrownOnEmptyMessage() { var input = Mock.Of <IStormInput <object> >(); var message = string.Empty; Assert.Throws <ArgumentException>(() => StormExtensions.SetError <object>(input, message)); }
public void SetErrorCallSetError() { const string message = "test"; var input = new Mock <IStormInput <object> >(MockBehavior.Strict); input.Setup(i => i.SetError(It.IsAny <StormToken>(), It.Is <StormError>(e => e.Message == message))); StormExtensions.SetError(input.Object, message); }
public void ConnectCallConnect() { var target = Mock.Of <IStorm <object> >(); var input = new Mock <IStormSocket <object> >(MockBehavior.Strict); input.Setup(i => i.Connect(It.IsAny <StormToken>(), target)); StormExtensions.Connect(input.Object, target); }
public void SetValueCallSetValue() { var value = new object(); var input = new Mock <IStormInput <object> >(MockBehavior.Strict); input.Setup(i => i.SetValue(It.IsAny <StormToken>(), value)); StormExtensions.SetValue(input.Object, value); }
public void MatchOnNullOnErrorThrow() { Assert.Throws <ArgumentNullException>(() => StormExtensions.Match <object>(Mock.Of <IStormContent <object> >(), v => throw new Exception(), null)); }
public void MatchOnNullContentThrow() { Assert.Throws <ArgumentNullException>(() => StormExtensions.Match <object>(null, v => throw new Exception(), v => throw new Exception())); }
public void SetValueDoNotThrowOnNullValue() { var input = Mock.Of <IStormInput <object> >(); StormExtensions.SetValue(input, null); }
public void SetValueThrownOnNullThisArgument() { Assert.Throws <ArgumentNullException>(() => StormExtensions.SetValue(null, new object())); }
public void SetErrorThrownOnNullMessage() { var input = Mock.Of <IStormInput <object> >(); Assert.Throws <ArgumentNullException>(() => StormExtensions.SetError <object>(input, null)); }
public void ConnectThrowOnNullTarget() { var socket = Mock.Of <IStormSocket <object> >(); Assert.Throws <ArgumentNullException>(() => StormExtensions.Connect(socket, null)); }
public void TryGetValueOnNullContentThrow() { Assert.Throws <ArgumentNullException>(() => StormExtensions.TryGetValue <object>(null, out _)); }
public void ConnectThrownOnNullThisArgument() { var target = Mock.Of <IStorm <object> >(); Assert.Throws <ArgumentNullException>(() => StormExtensions.Connect(null, target)); }
public void SetEmptyThrownOnNullThisArgument() { Assert.Throws <ArgumentNullException>(() => StormExtensions.SetEmpty <object>(null)); }
public void SwitchWithCompare2WithNullSelectorThrow() { Assert.Throws <ArgumentNullException>(() => StormExtensions.SwitchWithCompare(null, Mock.Of <IEqualityComparer <int> >())); }
public void SwitchWithoutCompare2Returns() { Assert.That(StormExtensions.SwitchWithoutCompare(Mock.Of <IStorm <IStorm <int> > >()), Is.Not.Null); }
public void SwitchWithoutCompareWithNullSelectorThrow() { Assert.Throws <ArgumentNullException>(() => StormExtensions.SwitchWithoutCompare <int>(null)); }
public void SwitchWithCompare2WithNullComparerThrow() { Assert.Throws <ArgumentNullException>(() => StormExtensions.SwitchWithCompare(Mock.Of <IStorm <IStorm <int> > >(), null)); }
public void GetValueOrThrowOnNullContentThrow() { Assert.Throws <ArgumentNullException>(() => StormExtensions.GetValueOrThrow <object>(null)); }
public void SetErrorThrownOnNullThisArgument() { Assert.Throws <ArgumentNullException>(() => StormExtensions.SetError <object>(null, "test")); }