public MockType AsCollection() { var mockCollectionType = new MockType(); mockCollectionType.Setup(t => t.GetInterfaces()).Returns(new[] { typeof(ICollection <>).MakeGenericType(this) }); return(mockCollectionType); }
public TestModelBuilder Entity(string name, bool addSet = true) { _entityType = _model.AddEntityType(name); Type type = new MockType(name); _entityType.Annotations.SetClrType(type); if (addSet) { _model.AddEntitySet(name + "Set", _entityType); } return(this); }
public TestModelBuilder Entity(string name, bool addSet = true) { _entityType = _model.AddEntityType(name); Type type = new MockType(name); _entityType.GetMetadataProperties().SetClrType(type); if (addSet) { _model.AddEntitySet(name + "Set", _entityType); } return(this); }