private void CreateSimulation() { IHttpResponse response = Request.Post(System.IO.File.ReadAllText(Constants.Path.SIMULATION_FILE)); if (HttpStatusCode.OK != response.StatusCode) { throw new Exception("Error while creating simulated devices. Request to device simulation service failed with " + response.StatusCode + " status code."); } }
public void DeviceDataUpdated_IfTagged() { // Arrange var tagsTemplate = System.IO.File.ReadAllText(Constants.Path.TAGS_FILE); string jobId = Guid.NewGuid().ToString(); tagsTemplate = tagsTemplate.Replace(Constants.Keys.JOB_ID, jobId) .Replace(Constants.Keys.DEVICE_ID, this.simulatedDeviceId) .Replace(Constants.Keys.FAULTY_DEVICE_ID, this.simulatedFaultyDeviceId); // Act var response = Request.Post(tagsTemplate); // Asserts Assert.Equal(HttpStatusCode.OK, response.StatusCode); var job = JObject.Parse(response.Content); Helper.Job.AssertJobwasCompletedSuccessfully(Constants.Jobs.TAG_JOB, Request, job); Helper.Job.CheckIfDeviceIsTagged(tagsTemplate, this.simulatedDeviceId); Helper.Job.CheckIfDeviceIsTagged(tagsTemplate, this.simulatedFaultyDeviceId); }