コード例 #1
0
        public void DeleteResourcePoolViews_OnError_ThrowException()
        {
            // Arrange
            ShimGridViewManagerFactory.Constructor = _ =>
            {
                throw new Exception(DummyError);
            };

            // Act
            Action action = () => ResourceGridClass.DeleteResourcePoolViews(string.Empty, _web.Instance);

            // Assert
            Should.Throw <APIException>(action).Message.ShouldBe(DummyError);
        }
コード例 #2
0
        public void DeleteResourcePoolViews_OnValidCall_ConfirmResult()
        {
            // Arrange
            var xmlString = CreateXMLString();

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

            // Assert
            this.ShouldSatisfyAllConditions(
                () => _gridViewRemoved.ShouldBeTrue(),
                () => _cacheRemoved.ShouldBeTrue(),
                () => result.ShouldBe(ResourcePoolViewsClosedTag));
        }