public void CanOpenWebWithNoArgument() { //Arrange var web = new SPWebSubstitute(); //Act Sut.OpenWeb().Returns(web); //Assert using (var site = GetSite()) { Assert.That(site.OpenWeb(), Is.SameAs(web.SpType)); } }
public SPWebSubstitute(Arg args) { WebsCollections = new WebsCollections(); Webs = new WebsSubstitute(this); Lists = new ListsSubstitute(this); if (args == null) { var site = new SPSiteSubstitute(Arg.Any()); site.OpenWeb().Returns(this); } Webs.Returns(WebsCollections); }