public override void TestInitialize() { base.TestInitialize(); ShimClientContext.AllInstances.ExecuteQuery = (a) => { }; ShimClientContext.AllInstances.WebGet = (a) => new ShimWeb(); ShimWeb.AllInstances.ListsGet = (a) => new ShimListCollection(); var spContextHelper = Substitute.For <ISharePointContextHelper>(); spContextHelper.ClientContext.Returns(new ShimClientContext()); fakeColumnMapping = Substitute.For <IColumnMappingResolver>(); sharePointSerivce = new SharePointService(spContextHelper, fakeColumnMapping); }
/// <summary> /// Default constructor. /// </summary> /// <param name="httpContext">Http context which will be used to communicate /// with SharePoint.</param> public SharePointService(ISharePointContextHelper contextHelper, IColumnMappingResolver columnMapping) { this.contextHelper = contextHelper; this.columnMapping = columnMapping; }