Exemple #1
0
        public void TestAddBall()
        {
            // Arrange:

            // Create the fake stockFeed:
            var      fakePerson = A.Fake <IPerson>();
            IStudent student    = new Student();

            // Act:
            A.CallTo(() => fakePerson.Age).Returns(15);
            A.CallTo(() => fakePerson.Name).Returns("Dima");
            student.Person = fakePerson;
            student.AddBall(3.5);
            // Assert:
            Assert.AreEqual(3.5d, student.avgBall);
            Assert.AreEqual(fakePerson, student.Person);
        }