コード例 #1
0
        public void Execute_ReturnsEmpty_WhenSupposedDigitIsWrong()
        {
            var wrongDigit = new SupposedDigit <object>(1, new object());

            IEvaluationResult actual = _instance.Execute(wrongDigit);

            actual.ShouldBeOfType <EmptyEvaluationResult>();
        }
コード例 #2
0
        public void Execute_ReturnsCow_WhenIndexIsWrong()
        {
            var cowDigit = new SupposedDigit <object>(1, _value);

            IEvaluationResult actual = _instance.Execute(cowDigit);

            actual.ShouldBeOfType <Cow <object> >();
        }
コード例 #3
0
        public void Execute_ReturnsBull_WhenSupposedDigitIsRight()
        {
            var rightDigit = new SupposedDigit <object>(0, _value);

            IEvaluationResult actual = _instance.Execute(rightDigit);

            actual.ShouldBeOfType <Bull <object> >();
        }
コード例 #4
0
        public void Execute_CallsGet_FromRepository()
        {
            var rightDigit = new SupposedDigit <object>(0, _value);

            _instance.Execute(rightDigit);

            _repository.Verify(instance => instance.Get <object>());
        }
コード例 #5
0
        private void WithDigit(int index, object digit)
        {
            var secretDigit = new SupposedDigit <TValue>(index, (TValue)digit);

            _digits.Add(secretDigit);
        }
コード例 #6
0
        private static ISupposedNumber <object> BuildSupposedNumber()
        {
            var supposedDigit = new SupposedDigit <object>(0, new object());

            return(new SupposedNumber <object>(new[] { supposedDigit }));
        }