示例#1
0
        public void ReadData_UseSpecificFakeObject_ReturnSpecifiedValue()
        {
            //Setup fake database
            var fakeValue = 42;

            _fakeDatabase.ReadData().Returns(fakeValue);

            var data = _target2.GetData();

            Assert.AreEqual(fakeValue, data);
        }
示例#2
0
        public void ReadData_UseRealObject_ThrowException()
        {
            var db = new FakeDatabase();

            _target2 = new Target2(db);

            Assert.Throws <NotImplementedException>(() => _target2.GetData());
        }