public void GetStubForKey_DidNotAddStubForTheKey_ThrowsKeyNotFoundException() { var stub = new StubBuilder(); TestDelegate invokeGetStub = () => stub.Get <double>(For.GameId); Assert.Throws <KeyNotFoundException>(invokeGetStub); }
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)); }
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); }