private Appointment GetAppointmentDataById(string id) { int neededId = GetNeededId(id, SdcaParts.appointment); Appointment appointment = new AppointmentSteps().GetAppointmentById(neededId); ScenarioContext.Set(appointment, "actualAppointment"); return(appointment); }
public void ThenAppointmentDataWithIdIsConnectedWithFollowingObject(string id, SdcaParts sdcaPart, Table table) { int neededId = GetNeededId(id, SdcaParts.appointment); object expectedObject = sdcaPart switch { SdcaParts.debt => Transformations.GetDebtBasedOnDebtCreator(StepArgumentTransformations.GetDebtCreator(table)), SdcaParts.collector => Transformations.GetCollectorBasedOnCollectorCreator(StepArgumentTransformations.GetCollectorCreator(table)), _ => null }; Appointment appointment = new AppointmentSteps().GetAppointmentById(neededId); object actualObject = sdcaPart switch { SdcaParts.debt => new DebtSteps().GetDebtById(appointment.debtId), SdcaParts.collector => new CollectorSteps().GetCollectorById(appointment.collectorIds[0]), _ => null }; Assert.AreEqual(expectedObject, actualObject, PropertiesDescriber.GetActualAndExpectedObjectsProperties(expectedObject, actualObject)); }