コード例 #1
0
        public void FakesStubInvocation()
        {
            var mathStub = new StubIMath();

            mathStub.MultiplyInt32Int32 = (a, b) => 15;
            var randomStub = new StubIRandomGenerator();

            var number = new Number(mathStub, randomStub, 5);
            var result = number.MultiplyBy(3);

            Assert.AreEqual(15, result.Value);
        }
コード例 #2
0
        public void FakesStubInvocation()
        {
            var mathStub   = new StubIMath();
            var randomStub = new StubIRandomGenerator();

            var number  = new Number(mathStub, randomStub, 5);
            var number2 = new StubINumber();

            number2.ValueGet = () => 5;

            Assert.IsTrue(number.Equals(number2));
        }