public void GetResourcePoolDataGridChanges_WhenDeleted_ConfirmResult() { // Arrange var xmlString = CreateXMLForGetResourcePoolDataGridChanges("Deleted", DummyIntOne); // Act var result = ResourceGridClass.GetResourcePoolDataGridChanges(xmlString, _web); // Assert this.ShouldSatisfyAllConditions( () => result.ShouldContain(ResourcePoolDataGridChangesTag), () => result.ShouldNotContain(IAdded)); }
public void GetResourcePoolDataGridChanges_OnError_ThrowException() { // Arrange var xmlString = CreateXMLForGetResourcePoolDataGridChanges(string.Empty, DummyIntOne); ShimGridGanttSettings.ConstructorSPList = (_, __) => { throw new Exception(DummyError); }; // Act Action action = () => ResourceGridClass.GetResourcePoolDataGridChanges(xmlString, _web); // Assert Should.Throw <APIException>(action).Message.ShouldBe(DummyError); }
public void GetResourcePoolDataGridChanges_WhenOtherOption_ConfirmResult() { // Arrange var xmlString = CreateXMLForGetResourcePoolDataGridChanges("Other", DummyIntTwo); ShimUtils.GetGridEnumSPSiteSPFieldStringOutInt32OutStringOut = (SPSite site, SPField field, out string enumValues, out int enumRange, out string enumKeys) => { enumValues = DummyString; enumRange = DummyIntOne; enumKeys = DummyString; }; // Act var result = ResourceGridClass.GetResourcePoolDataGridChanges(xmlString, _web); // Assert this.ShouldSatisfyAllConditions( () => result.ShouldContain(ResourcePoolDataGridChangesTag), () => result.ShouldNotContain(IAdded), () => result.ShouldContain(IOther)); }