public void DoSomeATestWorkWithLoopWithMoq_ParameterOnDependency_Test()
 {
     Mock<IDependency1> mockDependency1 = new Mock<IDependency1>();
     Mock<IDependency2> mockDependency2 = new Mock<IDependency2>();
     Mock<IDependency3> mockDependency3 = new Mock<IDependency3>();
     Dependent dependent = new Dependent(mockDependency1.Object, mockDependency2.Object, mockDependency3.Object);
     dependent.DoSomeATestWorkWithLoopWithMoq("[", "]");
     mockDependency1.Verify(d1 => d1.Dependency1Method(It.IsAny<string>(), It.IsAny<string>()), Times.Exactly(4));
 }
        public void DoSomeATestWorkWithMoq_NoParametersOnDependencies_Test()
        {
            string expected = "God - is - great.";
            Mock<IDependency1> mockDependency1 = new Mock<IDependency1>();
            Mock<IDependency2> mockDependency2 = new Mock<IDependency2>();
            Mock<IDependency3> mockDependency3 = new Mock<IDependency3>();

            mockDependency1.Setup(d1=>d1.Dependency1Method()).Returns("God");
            mockDependency2.Setup(d2=>d2.Dependency2Method()).Returns("is");
            mockDependency3.Setup(d3=>d3.Dependency3Method()).Returns("great.");
            Dependent dependent = new Dependent(mockDependency1.Object, mockDependency2.Object, mockDependency3.Object);
            string actual = dependent.DoSomeATestWorkWithMoq();

            Assert.AreEqual(expected, actual);
        }
 /// <summary>
 /// Defines the program entry point. 
 /// </summary>
 /// <param name="args">An array of <see cref="T:System.String"/> containing command line parameters.</param>
 private static void Main(string[] args)
 {
     Dependent dependent = new Dependent(new Dependency1(), new Dependency2(), new Dependency3());
     Console.WriteLine(dependent.DoSomeATestWorkWithMoq("<", ">"));
     Console.ReadLine();
 }
        public void DoSomeATestWorkWithMoq_ParameterOnDependency_Test()
        {
            string expected = "[God] - is - great.";
            Mock<IDependency1> mockDependency1 = new Mock<IDependency1>();
            Mock<IDependency2> mockDependency2 = new Mock<IDependency2>();
            Mock<IDependency3> mockDependency3 = new Mock<IDependency3>();

            mockDependency1.Setup(d1 => d1.Dependency1Method(It.IsAny<string>(), It.IsAny<string>())).Returns("[God]");
            mockDependency2.Setup(d2 => d2.Dependency2Method()).Returns("is");
            mockDependency3.Setup(d3 => d3.Dependency3Method()).Returns("great.");

            Dependent dependent = new Dependent(mockDependency1.Object, mockDependency2.Object, mockDependency3.Object);
            string actual = dependent.DoSomeATestWorkWithMoq("[", "]");
            mockDependency1.Verify(d1 => d1.Dependency1Method(It.IsAny<string>(), It.IsAny<string>()), Times.Once());
            Assert.AreEqual(expected, actual);
        }