コード例 #1
0
        public void GetResourcePoolLayoutGrid_WhenNoRoot_ThrowException()
        {
            // Arrange, Act
            Action action = () => ResourceGridClass.GetResourcePoolLayoutGrid(string.Empty, _web);

            // Assert
            var exception = Should.Throw <APIException>(action);

            this.ShouldSatisfyAllConditions(
                () => exception.ShouldNotBeNull(),
                () => exception.Message.ShouldBe(RootElementIsMissing));
        }
コード例 #2
0
        public void GetResourcePoolLayoutGrid_OnValidCall_ConfirmResult()
        {
            // Arrange
            var xmlString = $@"
                <Root>
                    <Id>{DummyString}</Id>
                </Root>";

            // Act
            var result = ResourceGridClass.GetResourcePoolLayoutGrid(xmlString, _web);

            // Assert
            this.ShouldSatisfyAllConditions(
                () => result.ShouldNotBeNullOrEmpty(),
                () => result.ShouldContain(GridTag),
                () => result.ShouldContain(CfgTag));
        }