public async Task Load_Excel_File_v1_FollowUp_Configuration_WithFileSelected_OneRow_CheckCrateStructure() { // Act var responseFollowUpActionDTO = await ConfigureFollowUp(true, HealthMonitor_FixtureData.GetFilePath_OneRowWithWithHeader()); // Assert Assert.NotNull(responseFollowUpActionDTO, "Response from followup configuration request is null"); Assert.NotNull(responseFollowUpActionDTO.CrateStorage, "Response from followup configuration request doesn't contain crate storage"); Assert.NotNull(responseFollowUpActionDTO.CrateStorage.Crates, "Response from followup configuration request doesn't contain crates in storage"); var crateStorage = _crateManager.GetStorage(responseFollowUpActionDTO); Assert.AreEqual(1, crateStorage.CratesOfType <StandardConfigurationControlsCM>().Count(), "Activity storage doesn't contain configuration controls"); Assert.AreEqual(1, crateStorage.CratesOfType <CrateDescriptionCM>().Count(), "Activity storage doesn't contain description of runtime available crates"); /* Assert.AreEqual(3, crateStorage.CratesOfType<FieldDescriptionsCM>().Count(), "Although one-row table is supplied, there seems to be no FieldDescriptionsCM crate with fields from the first row"); * Assert.AreEqual(2, * crateStorage.CratesOfType<FieldDescriptionsCM>().Count(x => x.Availability == AvailabilityType.Always), * "Activity storage doesn't contain crate with column headers that is avaialbe both at design time and runtime"); */ // Load file with multiple rows: crate with extracted fields must disappear responseFollowUpActionDTO = await ConfigureFollowUp(true, null, responseFollowUpActionDTO); crateStorage = _crateManager.GetStorage(responseFollowUpActionDTO); // Assert.AreEqual(2, crateStorage.CratesOfType<FieldDescriptionsCM>().Count(), "Although a multi-row table has been uploaded, the crate with extracted fields did not seem to have disappeared"); }
public async Task Load_Excel_File_v1_Run_WhenFileIsSelected_OneRow_ResponseContainsExtractedFields() { var activityDTO = await ConfigureFollowUp(true, HealthMonitor_FixtureData.GetFilePath_OneRowWithWithHeader()); var runUrl = GetTerminalRunUrl(); var dataDTO = new Fr8DataDTO { ActivityDTO = activityDTO }; AddOperationalStateCrate(dataDTO, new OperationalStateCM()); var responsePayloadDTO = await HttpPostAsync <Fr8DataDTO, PayloadDTO>(runUrl, dataDTO); var payload = _crateManager.GetStorage(responsePayloadDTO).CratesOfType <StandardPayloadDataCM>(); Assert.AreEqual(1, payload.Count(), "Reponse payload doesn't contain extracted fields data from file"); Assert.AreEqual(4, payload.First().Content.PayloadObjects[0].PayloadObject.Count(), "Reponse payload doesn't contain extracted fields data from file"); }