Esempio n. 1
0
        public void FilterChangeLogRecordsByWorkload()
        {
            // Arrange
            var changeLogRecords = new ChangeLogRecords
            {
                ChangeLogs = ChangeLogRecordsModelShould.GetChangeLogRecords().ChangeLogs
            };

            var searchOptions = new ChangeLogSearchOptions(workload: "Compliance");

            // Act
            var changeLog = Services.ChangesService.FilterChangeLogRecords(changeLogRecords, searchOptions, _graphProxyConfigs);

            // Assert
            Assert.NotNull(changeLog);
            Assert.Collection(changeLog.ChangeLogs,
                              item =>
            {
                Assert.Equal("6a6c7aa0-4b67-4d07-9ebf-c2bc1bcef553", item.Id);
                Assert.Equal("Compliance", item.WorkloadArea);
                Assert.Equal("eDiscovery", item.SubArea);
                Assert.Collection(item.ChangeList,
                                  item =>
                {
                    Assert.Equal("6a6c7aa0-4b67-4d07-9ebf-c2bc1bcef553", item.Id);
                    Assert.Equal("Resource", item.ApiChange);
                    Assert.Equal("ediscoveryCase,reviewSet,reviewSetQuery", item.ChangedApiName);
                    Assert.Equal("Addition", item.ChangeType);
                    Assert.Equal("ediscoveryCase,reviewSet,reviewSetQuery", item.Target);
                });
            });
        }
Esempio n. 2
0
        public void FilterChangeLogRecordsByEndDateAndDaysRange()
        {
            // Arrange
            var changeLogRecords = new ChangeLogRecords
            {
                ChangeLogs = ChangeLogRecordsModelShould.GetChangeLogRecords().ChangeLogs
            };
            var endDate = DateTime.Parse("2021-01-01");

            var searchOptions = new ChangeLogSearchOptions(endDate: endDate, daysRange: 30);

            // Act
            var changeLog = Services.ChangesService.FilterChangeLogRecords(changeLogRecords, searchOptions, _graphProxyConfigs);

            // Assert
            Assert.NotNull(changeLog);
            Assert.Collection(changeLog.ChangeLogs,
                              item =>
            {
                Assert.Equal("dca6467b-d026-4316-8353-2c6c02598af3", item.Id);
                Assert.Equal("Reports", item.WorkloadArea);
                Assert.Equal("Identity and access reports", item.SubArea);
                Assert.Collection(item.ChangeList,
                                  item =>
                {
                    Assert.Equal("dca6467b-d026-4316-8353-2c6c02598af3", item.Id);
                    Assert.Equal("Resource", item.ApiChange);
                    Assert.Equal("relyingPartyDetailedSummary,listing", item.ChangedApiName);
                    Assert.Equal("Addition", item.ChangeType);
                    Assert.Equal("relyingPartyDetailedSummary,listing", item.Target);
                });
            });
        }
Esempio n. 3
0
        public void PaginateChangeLogRecordsFirstPage()
        {
            // Arrange
            var changeLogRecords = new ChangeLogRecords
            {
                ChangeLogs = ChangeLogRecordsModelShould.GetChangeLogRecords().ChangeLogs
            };

            var searchOptions = new ChangeLogSearchOptions
            {
                Page      = 1,
                PageLimit = 2
            };

            // Act
            var changeLog = Services.ChangesService.FilterChangeLogRecords(changeLogRecords, searchOptions, _graphProxyConfigs);

            // Assert -- fetch first two items from the changelog sample
            Assert.NotNull(changeLog);
            Assert.Collection(changeLog.ChangeLogs,
                              item =>
            {
                Assert.Equal("6a6c7aa0-4b67-4d07-9ebf-c2bc1bcef553", item.Id);
                Assert.Equal("Compliance", item.WorkloadArea);
                Assert.Equal("eDiscovery", item.SubArea);
                Assert.Collection(item.ChangeList,
                                  item =>
                {
                    Assert.Equal("6a6c7aa0-4b67-4d07-9ebf-c2bc1bcef553", item.Id);
                    Assert.Equal("Resource", item.ApiChange);
                    Assert.Equal("ediscoveryCase,reviewSet,reviewSetQuery", item.ChangedApiName);
                    Assert.Equal("Addition", item.ChangeType);
                    Assert.Equal("ediscoveryCase,reviewSet,reviewSetQuery", item.Target);
                });
            },
                              item =>
            {
                Assert.Equal("2d94636a-2d78-44d6-8b08-ff2a9121214b", item.Id);
                Assert.Equal("Extensions", item.WorkloadArea);
                Assert.Equal("Schema extensions", item.SubArea);
                Assert.Collection(item.ChangeList,
                                  item =>
                {
                    Assert.Equal("2d94636a-2d78-44d6-8b08-ff2a9121214b", item.Id);
                    Assert.Equal("Resource", item.ApiChange);
                    Assert.Equal("schema extensions,Microsoft Cloud for US Government.", item.ChangedApiName);
                    Assert.Equal("Addition", item.ChangeType);
                    Assert.Equal("schema extensions,Microsoft Cloud for US Government", item.Target);
                });
            });
        }
Esempio n. 4
0
        public void FilterChangeLogRecordsByDates()
        {
            // Arrange
            var changeLogRecords = new ChangeLogRecords
            {
                ChangeLogs = ChangeLogRecordsModelShould.GetChangeLogRecords().ChangeLogs
            };
            var startDate     = DateTime.Parse("2020-01-01");
            var endDate       = DateTime.Parse("2020-10-01");
            var searchOptions = new ChangeLogSearchOptions(startDate: startDate, endDate: endDate);

            // Act
            var changeLog = Services.ChangesService.FilterChangeLogRecords(changeLogRecords, searchOptions, _graphProxyConfigs);

            // Assert
            Assert.NotNull(changeLog);
            Assert.Collection(changeLog.ChangeLogs,
                              item =>
            {
                Assert.Equal("6a6c7aa0-4b67-4d07-9ebf-c2bc1bcef553", item.Id);
                Assert.Equal("Compliance", item.WorkloadArea);
                Assert.Equal("eDiscovery", item.SubArea);
                Assert.Collection(item.ChangeList,
                                  item =>
                {
                    Assert.Equal("6a6c7aa0-4b67-4d07-9ebf-c2bc1bcef553", item.Id);
                    Assert.Equal("Resource", item.ApiChange);
                    Assert.Equal("ediscoveryCase,reviewSet,reviewSetQuery", item.ChangedApiName);
                    Assert.Equal("Addition", item.ChangeType);
                    Assert.Equal("ediscoveryCase,reviewSet,reviewSetQuery", item.Target);
                });
            },
                              item =>
            {
                Assert.Equal("2d94636a-2d78-44d6-8b08-ff2a9121214b", item.Id);
                Assert.Equal("Extensions", item.WorkloadArea);
                Assert.Equal("Schema extensions", item.SubArea);
                Assert.Collection(item.ChangeList,
                                  item =>
                {
                    Assert.Equal("2d94636a-2d78-44d6-8b08-ff2a9121214b", item.Id);
                    Assert.Equal("Resource", item.ApiChange);
                    Assert.Equal("schema extensions,Microsoft Cloud for US Government.", item.ChangedApiName);
                    Assert.Equal("Addition", item.ChangeType);
                    Assert.Equal("schema extensions,Microsoft Cloud for US Government", item.Target);
                });
            });
        }
Esempio n. 5
0
        public void PaginateChangeLogRecordsLastPage()
        {
            // Arrange
            var changeLogRecords = new ChangeLogRecords
            {
                ChangeLogs = ChangeLogRecordsModelShould.GetChangeLogRecords().ChangeLogs
            };

            var searchOptions = new ChangeLogSearchOptions
            {
                Page      = 2,
                PageLimit = 2
            };

            // Act
            var changeLog = Services.ChangesService.FilterChangeLogRecords(changeLogRecords, searchOptions, _graphProxyConfigs);

            // Assert -- fetch last item from the changelog sample
            Assert.NotNull(changeLog);
            Assert.Collection(changeLog.ChangeLogs,
                              item =>
            {
                Assert.Equal("dca6467b-d026-4316-8353-2c6c02598af3", item.Id);
                Assert.Equal("Reports", item.WorkloadArea);
                Assert.Equal("Identity and access reports", item.SubArea);
                Assert.Collection(item.ChangeList,
                                  item =>
                {
                    Assert.Equal("dca6467b-d026-4316-8353-2c6c02598af3", item.Id);
                    Assert.Equal("Resource", item.ApiChange);
                    Assert.Equal("relyingPartyDetailedSummary,listing", item.ChangedApiName);
                    Assert.Equal("Addition", item.ChangeType);
                    Assert.Equal("relyingPartyDetailedSummary,listing", item.Target);
                });
            });
        }
Esempio n. 6
0
        public void PaginateChangeLogRecordsMiddlePage()
        {
            // Arrange
            var changeLogRecords = new ChangeLogRecords
            {
                ChangeLogs = ChangeLogRecordsModelShould.GetChangeLogRecords().ChangeLogs
            };

            var searchOptions = new ChangeLogSearchOptions
            {
                Page      = 2,
                PageLimit = 1
            };

            // Act
            var changeLog = Services.ChangesService.FilterChangeLogRecords(changeLogRecords, searchOptions, _graphProxyConfigs);

            // Assert -- fetch middle item from the changelog sample
            Assert.NotNull(changeLog);
            Assert.Collection(changeLog.ChangeLogs,
                              item =>
            {
                Assert.Equal("2d94636a-2d78-44d6-8b08-ff2a9121214b", item.Id);
                Assert.Equal("Extensions", item.WorkloadArea);
                Assert.Equal("Schema extensions", item.SubArea);
                Assert.Collection(item.ChangeList,
                                  item =>
                {
                    Assert.Equal("2d94636a-2d78-44d6-8b08-ff2a9121214b", item.Id);
                    Assert.Equal("Resource", item.ApiChange);
                    Assert.Equal("schema extensions,Microsoft Cloud for US Government.", item.ChangedApiName);
                    Assert.Equal("Addition", item.ChangeType);
                    Assert.Equal("schema extensions,Microsoft Cloud for US Government", item.Target);
                });
            });
        }