Exemplo n.º 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.AreEqual((object)constant.PropValue, result);
        }
Exemplo n.º 2
0
 public ClassWithVirtualDependencies(IDependency dependency, VirtualDependency virtualDependency)
 {
     _virtualDependency = virtualDependency;
     Dependency = dependency;
 }
Exemplo n.º 3
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.AreEqual((object) constant.PropValue, result);
        }
Exemplo n.º 4
0
 public ClassWithVirtualDependencies(IDependency dependency, VirtualDependency virtualDependency)
 {
     _virtualDependency = virtualDependency;
     Dependency         = dependency;
 }