public void DisableTimesheets_Should_RemoveStringFromList() { // Arrange var actualEpmLiveTsLists = string.Empty; var list = new ShimSPList() { FieldsGet = () => new ShimSPFieldCollection() { GetFieldByInternalNameString = internalName => new ShimSPField() }, TitleGet = () => DummyTitle }; var web = new ShimSPWeb() { SiteGet = () => new ShimSPSite() { RootWebGet = () => new ShimSPWeb() } }; ShimSPFieldLink.ConstructorSPField = (sender, spField) => new ShimSPFieldLink(); ShimCoreFunctions.getConfigSettingSPWebString = (rootWeb, setting) => $"{DummyTitle}\r\n{DummyInternalName}"; ShimCoreFunctions.setConfigSettingSPWebStringString = (rootWeb, setting, value) => actualEpmLiveTsLists = value; // Act ListCommands.DisableTimesheets(list, web); // Assert actualEpmLiveTsLists.ShouldBe(DummyInternalName); }