public void MockDependencyProperty <D>(string dependencyPath, string propName, object value, bool overrideIfSet = true) where D : class { var dependency = MockMoq <D> .Create(); SetPropPath(dependencyPath, dependency, overrideIfSet); dependency.OnGetProperty(propName).Returns(value); }
public static MockMoq <T> Create() { var instance = new MockMoq <T>(); instance._mockObj = new Mock <T>(); return(instance); }
public void MockDependencyMethodCall <D>(string dependencyPath, string methodName, object value, bool overrideIfSet = true) where D : class { var dependency = MockMoq <D> .Create(); SetPropPath(dependencyPath, dependency, overrideIfSet); dependency.OnCall(methodName).Returns(value); }
static public MockMoq <D> MockClassMethods <D, RT>(string dependencyClass, Dictionary <string, object> members) where D : class { var dependency = MockMoq <D> .Create(); // var dependency = new Mock<D>(); foreach (var pair in members) { var methodName = pair.Key; var returnValue = pair.Value; dependency.OnCall(methodName).ReturnsExplicit <RT>(returnValue); } return(dependency); }
public static MockMoq <T> CreateMocked <T>() where T : class { return(MockMoq <T> .Create()); }
public static MockMoq <T> AddMockedProp <T>(MockMoq <T> mockObj, string name, object value = null) where T : class { return(mockObj.SetProperty(name, value)); }
public static MockMoq <object> CreateMocked() { return(MockMoq <object> .Create()); }
protected MockMoq <TM> CreateMocked <TM>() where TM : class { return(MockMoq <TM> .Create()); }
public DbMocker(MockMoq <DbSet <T> > userDbSet, IEnumerable <T> dataSet) : this(userDbSet, dataSet.AsQueryable()) { }
public DbMocker(MockMoq <DbSet <T> > dbSet, IQueryable <T> queryableDataSet) { _dbSet = dbSet; _queryableDataSet = queryableDataSet; }