示例#1
0
        public void GetStubForKey_DidNotAddStubForTheKey_ThrowsKeyNotFoundException()
        {
            var stub = new StubBuilder();

            TestDelegate invokeGetStub = () => stub.Get <double>(For.GameId);

            Assert.Throws <KeyNotFoundException>(invokeGetStub);
        }
示例#2
0
        public void GetStubForKey_AddedStubForTheKey_ReturnsStubbedValue()
        {
            const int stubValue = 11;
            var       stub      = new StubBuilder();

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

            Assert.That(stub.Get <int>(For.GameId), Is.EqualTo(stubValue));
        }
示例#3
0
        public void GetStubForKey_TargetTypeNotEqualStubbedType_ThrowsArgumentException()
        {
            const int stubValue = 11;
            var       stub      = new StubBuilder();

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

            TestDelegate invokeGetStub = () => stub.Get <double>(For.GameId);

            Assert.Throws <ArgumentException>(invokeGetStub);
        }