示例#1
0
        public void OutForKey_AddedStubForTheKey_ReturnsStubbedValue()
        {
            const int stubValue = 11;
            var       stub      = new StubBuilder();

            stub.Value(For.GameId).Is(stubValue);

            Assert.That(stub.Out <int>(For.GameId), Is.EqualTo(stubValue));
        }
示例#2
0
        public void OutForKey2_AddedTwoStubForDifferentKeys_ReturnsStubbedValueForKey2()
        {
            const int    stubValue1 = 11;
            const double stubValue2 = 111.0;
            var          stub       = new StubBuilder();

            stub.Value(For.GameId).Is(stubValue1);
            stub.Value(For.SB).Is(stubValue2);

            Assert.That(stub.Out <double>(For.SB), Is.EqualTo(stubValue2));
        }
示例#3
0
        public void OutForKey_TargetTypeNotEqualStubbedType_ThrowsArgumentException()
        {
            const int stubValue = 11;
            var       stub      = new StubBuilder();

            stub.Value(For.GameId).Is(stubValue);

            TestDelegate invokeOut = () => stub.Out <double>(For.GameId);

            Assert.Throws <ArgumentException>(invokeOut);
        }
示例#4
0
        public void OutForKey_DidNotAddStubForTheKey_ReturnsDefaultValue()
        {
            var stub = new StubBuilder();

            Assert.That(stub.Out <int>(For.GameId), Is.EqualTo(default(int)));
        }