示例#1
0
        public void TheQuestion()
        {
            var sut    = new TestMe();
            int result = sut.GetAnswer();

            Assert.AreEqual(42, result);
        }
示例#2
0
        public void BattleOfWits()
        {
            var sicilianMock = new Mock <ISicilian>();
            var goblet1      = new Goblet();
            var goblet2      = new Goblet();

            sicilianMock.Setup(x => x.SelectGlass(goblet1, goblet2)).Returns(goblet1);
            var sut = new TestMe(sicilianMock.Object);

            Goblet result = sut.Inconceivable(goblet1, goblet2);

            sicilianMock.Verify(x => x.SelectGlass(goblet1, goblet2), Times.Once());
            Assert.AreEqual(goblet2, result);
        }