public static IReadOnlyCollection <Period> GetHistoryFromFile() { string filePath = @"D:\\InterviewTest\InterviewTest.DriverData\DataFiles\HistoryData.json"; IDataFileReader fileDataReader = new FileDataReader(); string historyData = fileDataReader.ReadFileData(filePath); IDataParser jsondataParser = new JsonDataParser(); return(jsondataParser.ParseData <IReadOnlyCollection <Period> >(historyData)); }
/// <summary> /// Function to add multiple product lines. /// </summary> /// <param name="productLineData"></param> public void AddMultipleProducts(List <DataDictionary> productLineData) { foreach (DataDictionary data in productLineData) { ProductLineData productLine = JsonDataParser <ProductLineData> .ParseData(data.Value); Thread.Sleep(4000); ClickOnAddProduct().EnterWidth(productLine.Width).EnterHeight(productLine.Height).EnterRoomLocation(productLine.NDBRoomLocation) .SelectProduct(productLine.ProductType).SelectProductOptions(productLine.ProductDetails).ClickAddProductButton(); } }
/// <summary> /// Function to parse internal info data. /// </summary> /// <param name="featureData"></param> /// <returns></returns> public static InternalInfoData GetInternalInfoData(ParsedTestData featureData) { object internalInfoFeatureData = DataAccess.GetKeyJsonData(featureData, "InternalInfoSection"); return(JsonDataParser <InternalInfoData> .ParseData(internalInfoFeatureData)); }
public static UpdateCustomerData GetUpdateCustomerData(ParsedTestData featureData) { object updateCustomerFeatureData = DataAccess.GetKeyJsonData(featureData, "customer1"); return(JsonDataParser <UpdateCustomerData> .ParseData(updateCustomerFeatureData)); }
public static NewCustomerData GetCustomerData(ParsedTestData featureData) { object newCustomerFeatureData = DataAccess.GetKeyJsonData(featureData, "customer1"); return(JsonDataParser <NewCustomerData> .ParseData(newCustomerFeatureData)); }
public static LoginData GetLoginDataByKey(ParsedTestData loginFeatureParsedData, string key) { object loginDataByKey = DataAccess.GetKeyJsonData(loginFeatureParsedData, key); return(JsonDataParser <LoginData> .ParseData(loginDataByKey)); }