예제 #1
0
        public void Create_with_constant_concerete_dependency_uses_constant()
        {
            //Arrange
            var mocker = new AutoMoqer();

            var constant = new VirtualDependency()
            {
                PropValue = Guid.NewGuid().ToString()
            };

            mocker.SetInstance(constant);

            //Act
            var result = mocker.Create <ClassWithVirtualDependencies>().GetVirtualProperty();

            //Assert
            Assert.Equal((object)constant.PropValue, result);
        }
예제 #2
0
 public ClassWithVirtualDependencies(IDependency dependency, VirtualDependency virtualDependency)
 {
     _virtualDependency = virtualDependency;
     Dependency         = dependency;
 }