public DevicesListViewTest()
        {
            ApplicationURLS.SetURLS("https://localhost", "https://localhost");

            string data = JsonConvert.SerializeObject(new DevicesListViewModel(Devices, 1), SerializerSettings.Json);

            fakeDevicesHandler.AddFakeResponse(
                new Uri($"{ApplicationURLS.Backend}/api/devices"),
                new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(data)
            });

            fakeDataRestService = new RestService(new HttpClient(fakeDevicesHandler), mockTokenAcquisition,
                                                  mockConfiguration);
        }
        public MapViewControllerTest()
        {
            ApplicationURLS.SetURLS("https://localhost", "https://localhost");

            fakeDevicesHandler.AddFakeResponse(
                new Uri($"{ApplicationURLS.Backend}/api/devices"),
                new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(JsonConvert.SerializeObject(devices))
            });
            fakeDevicesHandler.AddFakeResponse(
                new Uri($"{ApplicationURLS.Backend}/api/projects"),
                new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new StringContent(JsonConvert.SerializeObject(new List <Project>()))
            });
        }
Esempio n. 3
0
        private void SetDeploymentURLs(string buildConfiguration)
        {
            string jsonFile;

            using (StreamReader r = new StreamReader("deploymentUrls.json"))
            {
                jsonFile = r.ReadToEnd();
            }

            JObject deploymentFile = JObject.Parse(jsonFile);

            if (deploymentFile != null)
            {
                ApplicationURLS.SetURLS(
                    deploymentFile[buildConfiguration]["BackendBaseUrl"].ToString(),
                    deploymentFile[buildConfiguration]["WebAppBaseUrl"].ToString()
                    );
            }
        }
Esempio n. 4
0
 public DeviceConfigViewTest()
 {
     ApplicationURLS.SetURLS("https://localhost", "https://localhost");
 }
 public DevicesDetailViewTest()
 {
     ApplicationURLS.SetURLS("https://localhost", "https://localhost");
 }
Esempio n. 6
0
 public ProjectListViewTest()
 {
     ApplicationURLS.SetURLS("https://localhost", "https://localhost");
 }