Beispiel #1
0
        public void Test_BeTested_Constructor()
        {
            Interface_One one = new IsOne();
            // Constructor one
            var target   = new BeTested(one);
            var result   = target.GetInternalNum();
            var expected = -1;

            Assert.AreEqual(expected, result, "Are they equal? {0} == {1}", new object[] { expected, result });
        }
Beispiel #2
0
        public void Test_BeTested_Mock_InterfaceOne()
        {
            // Set up mock for interface_one
            var intOne = new Mock <Interface_One>();

            intOne.Setup(m => m.DoSth1(55555)).Returns(true);
            intOne.Setup(m => m.Num).Returns(99999);

            var target = new BeTested(intOne.Object, 77777);

            Assert.AreEqual(77777, target.GetInternalNum());

            Assert.AreEqual(99999, target.GetOneNum());

            Assert.IsFalse(target.Check_IntOne_DoSth1());
        }