Пример #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);
        }