Ejemplo n.º 1
0
        public void GetAll_DataRowValueDifferentFrom1_ReturnsListManagerDocument()
        {
            // Arrange
            ShimSPListItemManager.AllInstances.ParentListGet = _ => new ShimSPList
            {
                ParentWebGet = () => new ShimSPWeb
                {
                    SiteGet = () => new ShimSPSite()
                }
            };
            ShimQueryExecutor.AllInstances.ExecuteReportingDBQueryStringIDictionaryOfStringObject =
                (_, query, parameters) => new ShimDataTable
            {
                RowsGet = () => new ShimDataRowCollection
                {
                    CountGet     = () => 1,
                    ItemGetInt32 = index => new ShimDataRow
                    {
                        ItemGetString = name => 2
                    }
                }
            };
            ShimSPListItemManager.AllInstances.GetAllBooleanBoolean =
                (_, includeHidden, includeReadOnly) => new ShimXDocument
            {
                NodeTypeGet = () => XmlNodeType.Document
            };

            // Act
            var result = resourcePoolManager.GetAll(true, true);

            // Assert
            result.ShouldSatisfyAllConditions(
                () => result.ShouldNotBeNull(),
                () => result.NodeType.ShouldBe(XmlNodeType.Document));
        }