Beispiel #1
0
        public void GetMockBeforeCreateInstanceWithNestedDependencyShouldReuseSameMock()
        {
            // Setup
            var dependentMock = _automocker.GetMock <IInterfaceWithDependency>();
            var mock          = _automocker.GetMock <ISimpleDependency>();

            // Exercise
            _automocker.MockDependencies(dependentMock);
            var instance = _automocker.GetInstance <ClassWithNestedDependency>();

            // Veridy
            Assert.That(instance.Dependency.Dependency, Is.SameAs(mock.Object));
        }