public void GetAuditDataWithARecordWithNoChanges()
        {
            SimpleDataWebServiceClient webServiceClient = Create();

            InMemoryRecord record = ProductionRecords.NewRecord().MarkAsNew();

            SubmitDataRequest submitRequest = new SubmitDataRequest
            {
                Credentials       = CreateCredentials(),
                SubmitDataRecords = new[]
                {
                    record.ConvertToSubmitDataRecord()
                }
            };

            webServiceClient.SubmitData(submitRequest);
            Assert.That(DatabaseRecords, Is.Not.Empty);
            int recordId = DatabaseRecords[0].RecordId;

            GetAuditDataRequest request = new GetAuditDataRequest
            {
                Credentials = CreateCredentials(),
                Filter      = new GetAuditDataFilter {
                    Location = location, Module = AmplaModules.Production, SetId = Convert.ToString(recordId)
                }
            };

            GetAuditDataResponse response = webServiceClient.GetAuditData(request);

            Assert.That(response.RowSets, Is.Not.Empty);
            Assert.That(response.RowSets[0].Rows, Is.Empty);
        }
        public void GetAuditDataWithARecordWithChanges()
        {
            SimpleDataWebServiceClient webServiceClient = Create();

            InMemoryRecord record = ProductionRecords.NewRecord().MarkAsNew();

            record.SetFieldValue("Field 1", 150);

            SubmitDataRequest submitRequest = new SubmitDataRequest
            {
                Credentials       = CreateCredentials(),
                SubmitDataRecords = new[]
                {
                    record.ConvertToSubmitDataRecord()
                }
            };

            webServiceClient.SubmitData(submitRequest);

            Assert.That(DatabaseRecords, Is.Not.Empty);
            int recordId = DatabaseRecords[0].RecordId;

            InMemoryRecord updateRecord = new InMemoryRecord(ProductionViews.StandardView())
            {
                Location = record.Location,
                Module   = record.Module,
                RecordId = recordId
            };

            updateRecord.SetFieldValue("Field 1", 200);

            SubmitDataRequest update = new SubmitDataRequest
            {
                Credentials       = CreateCredentials(),
                SubmitDataRecords = new[]
                {
                    updateRecord.ConvertToSubmitDataRecord()
                }
            };

            webServiceClient.SubmitData(update);

            GetAuditDataRequest request = new GetAuditDataRequest
            {
                Credentials = CreateCredentials(),
                Filter      = new GetAuditDataFilter {
                    Location = location, Module = AmplaModules.Production, SetId = Convert.ToString(recordId)
                }
            };

            GetAuditDataResponse response = webServiceClient.GetAuditData(request);

            AssertAuditTableContains(response, location, recordId, "Field 1", "150", "200");
        }
        public void GetAuditData()
        {
            SimpleDataWebServiceClient webServiceClient = Create();

            GetAuditDataRequest request = new GetAuditDataRequest
            {
                Credentials = CreateCredentials(),
                Filter      = new GetAuditDataFilter {
                    Location = location, Module = AmplaModules.Production
                }
            };

            GetAuditDataResponse response = webServiceClient.GetAuditData(request);

            Assert.That(response.RowSets, Is.Not.Empty);
            Assert.That(response.RowSets[0].Rows, Is.Empty);
        }