public void ReturnsValue_WhenValueIsSetInConstructor()
        {
            var testee = new Missable <string>(Value);

            testee.Value
            .Should().Be(Value);
        }
 public TransitionContext(IStateDefinition <TState, TEvent> stateDefinition, Missable <TEvent> eventId, object eventArgument, INotifier <TState, TEvent> notifier)
 {
     this.StateDefinition = stateDefinition;
     this.EventId         = eventId;
     this.EventArgument   = eventArgument;
     this.Notifier        = notifier;
 }
 public TransitionContext(IState <TState, TEvent> sourceState, Missable <TEvent> eventId, object eventArgument, INotifier <TState, TEvent> notifier)
 {
     this.sourceState   = sourceState;
     this.eventId       = eventId;
     this.eventArgument = eventArgument;
     this.Notifier      = notifier;
 }
示例#4
0
        public void ReturnsValue_WhenValueIsSetInConstructor()
        {
            var testee = new Missable<string>(Value);

            testee.Value
                .Should().Be(Value);
        }
示例#5
0
        public TransitionContext(IState <TState, TEvent> state, Missable <TEvent> eventId, object eventArgument, INotifier <TState, TEvent> notifier)
        {
            this.state         = state;
            this.eventId       = eventId;
            this.eventArgument = eventArgument;
            this.Notifier      = notifier;

            this.records = new List <Record>();
        }
示例#6
0
        public void ThrowsExceptionOnAccessingValue_WhenValueIsNotSet()
        {
            var testee = new Missable<string>();

            // ReSharper disable once UnusedVariable
            Action action = () => { string v = testee.Value; };

            action.ShouldThrow<InvalidOperationException>()
                .WithMessage("*missing*");
        }
        public void ThrowsExceptionOnAccessingValue_WhenValueIsNotSet()
        {
            var testee = new Missable <string>();

            // ReSharper disable once UnusedVariable
            Action action = () => { string v = testee.Value; };

            action.Should().Throw <InvalidOperationException>()
            .WithMessage("*missing*");
        }
示例#8
0
        public void ReturnsNotMissing_WhenValueIsSetInConstructor()
        {
            var testee = new Missable<string>(Value);

            testee.IsMissing.Should().BeFalse();
        }
示例#9
0
        public void ReturnsMissing_WhenNoValueIsSet()
        {
            var testee = new Missable<string>();

            testee.IsMissing.Should().BeTrue();
        }
示例#10
0
        public void ReturnsNotMissing_WhenValueIsSetInConstructor()
        {
            var testee = new Missable <string>(Value);

            testee.IsMissing.Should().BeFalse();
        }
示例#11
0
        public void ReturnsMissing_WhenNoValueIsSet()
        {
            var testee = new Missable <string>();

            testee.IsMissing.Should().BeTrue();
        }