Пример #1
0
        public void Arrange()
        {
            _httpClient = new Mock <SecureHttpClient>();

            _apiclient = new AuditApiClient(new AuditApiConfiguration {
                ApiBaseUrl = ExpectedApiBaseUrl
            }, _httpClient.Object);
        }
Пример #2
0
        private static void Audit(OAuthAuthenticationStrategy auth)
        {
            var            client = new AuditApiClient <SampleAuditLog>(auth, projectId);
            var            itemId = Guid.NewGuid().ToString();
            SampleAuditLog log    = new SampleAuditLogBuilder("sandbox2", "UPLOAD", "testuser", itemId, "test_uri", "/sitecore/content")
                                    .WithJob("test_job", "aabbcc", "batch1")
                                    .WithSourceVersion(1)
                                    .WithSourceLocale("en")
                                    .WithTargetLocale("ru-RU");

            client.Create(log);

            // Wait for audit log to be created and processed
            Thread.Sleep(1000);

            var query = new Dictionary <string, string>();

            query.Add("clientData.ItemId|clientData.Path", itemId);
            query.Add("sourceLocaleId", "en|ru");
            query.Add("envId", "sandbox2");

            var logs = client.Get(query, "_id:desc");
        }