public void Test_Multiply_Ok() { var basicOperation = new Mock <IBasicOperation>(); basicOperation.Setup(x => x.Add(It.IsAny <int>(), It.IsAny <int>())).Returns(1); var advancedOperation = new AdvancedOperation(basicOperation.Object); var resuts = advancedOperation.Multiply(5, 5); Assert.AreEqual(1, resuts); basicOperation.Verify(mock => mock.Add(It.IsAny <int>(), It.IsAny <int>()), Times.Exactly(5)); }
static void Main(string[] args) { var advancedOperation = new AdvancedOperation(new BasicOperation()); ExpertOperation expertOperation = new ExpertOperation(advancedOperation); var i = advancedOperation.Multiply(100, 4); var j = advancedOperation.Division(100, 5); advancedOperation.GetFibbonacci(10); expertOperation.Exponentiation(2, 5); expertOperation.Power(4, 16); expertOperation.Power2(4, 16); Console.ReadKey(); }