private static OemProfile LoadHttpOemProfile(string make, string model) { string deviceToken = OemSettings.Instance.OemProfiles[make][model]; return(MatterControlApplication.LoadCacheable <OemProfile>( String.Format("{0}.json", deviceToken), "profiles", () => { string responseText = null; responseText = RetrievePublicProfileRequest.DownloadPrinterProfile(deviceToken); return responseText; })); }
//[Test,Category("CloudProfiles")] public void RetrievePrinterProfileWorking() { string make = OemSettings.Instance.OemProfiles.First().Key; string model = OemSettings.Instance.OemProfiles[make].First().Key; deviceToken = OemSettings.Instance.OemProfiles[make][model]; string expectedProfilePath = Path.Combine(ApplicationDataStorage.ApplicationUserDataPath, "Profiles", string.Format("{0}.json", deviceToken)); if (File.Exists(expectedProfilePath)) { File.Delete(expectedProfilePath); } RetrievePublicProfileRequest request = new RetrievePublicProfileRequest(); string recievedPrinterProfile = RetrievePublicProfileRequest.DownloadPrinterProfile(deviceToken); Assert.IsNotNullOrEmpty(recievedPrinterProfile); //Assert.AreEqual(expectedProfilePath, recievedProfilePath,"Received Profile path does not match expected path."); //Assert.IsTrue(File.Exists(expectedProfilePath)); }