Esempio n. 1
0
 public TemperatureWorker(
     ILogger <TemperatureWorker> logger,
     TemperatureService temperatureService)
 {
     _logger             = logger;
     _temperatureService = temperatureService;
 }
Esempio n. 2
0
        private void InitializeInformations()
        {
            PleaseWaitWindow pleaseWaitWindow = new PleaseWaitWindow();

            pleaseWaitWindow.Show();

            SystemService systemService = new SystemService();

            systemService.InsertInformationsToListView(ref systemView);
            ProcessorService processorService = new ProcessorService();

            processorService.InsertInformationsToListView(ref processorView);
            MotherboardService motherboardService = new MotherboardService();

            motherboardService.InsertInformationsToListView(ref motherboardView);
            MemoryService memoryService = new MemoryService();

            memoryService.InsertInformationsToListView(ref memoryView);
            VideoAdapterService videoAdapterService = new VideoAdapterService();

            videoAdapterService.InsertInformationsToListView(ref videoAdapterView);
            AudioService audioService = new AudioService();

            audioService.InsertInformationsToListView(ref audioView);
            DrivesService drivesService = new DrivesService();

            drivesService.InsertInformationsToListView(ref drivesView);
            TemperatureService temperatureService = new TemperatureService();

            temperatureService.InsertInformationsToListView(ref temperatureView);

            pleaseWaitWindow.Close();
        }
Esempio n. 3
0
        public TempForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            // Send it to the tray on startup.
            this.ToTray();

            // Load the options from the registry.
            this.LoadOptions();

            // Update the dialog for the new options.
            this.UpdateDialog();

            // Set the icon to ?? until it updates the temperature.
            this.UpdateIcon("??");

            // Initialize the service to get the temperature.
            service = new TemperatureService();

            // Update the temperature.
            this.GetTemp();
        }
Esempio n. 4
0
        public async Task TemperatureConverter_WhenCalled_ReturnsTemperatureConverterNull()
        {
            var temperatureService = new TemperatureService();
            var res = await temperatureService.TemperatureConverter(1, "", "c");

            Assert.Equal("1", res.ToString());
        }
Esempio n. 5
0
        public static void Main(string[] args)
        {
            const string zipCode = "SeattleZipCode";

            // GeoLocService geoLookupService = new GeoLocService();

            // string city = geoLookupService.GetCityForZipCode(zipCode);
            // string state = geoLookupService.GetStateForZipCode(zipCode);
            // Coordinates coords = geoLookupService.GetCoordinatesForZipCode(zipCode);

            // WeatherService weatherService = new WeatherService();
            // double farenheit = weatherService.GetTempFarenheit(coords.Latitude, coords.Longitude);

            // MetricConverterService metricConverter = new MetricConverterService();
            // double celcius = metricConverter.FarenheitToCelcius(farenheit);


            ITemperatureService temperatureService = new TemperatureService();
            LocalTemperature    localTemp          = temperatureService.GetTemperature(zipCode);

            Console.WriteLine("The current temperature is {0}F/{1}C. in {2}, {3}",
                              localTemp.Farenheit.ToString("F1"),
                              localTemp.Celcius.ToString("F1"),
                              localTemp.City,
                              localTemp.State);

            Console.ReadKey();
        }
        public void Should_Parse_DateTime_Correctly()
        {
            var service = new TemperatureService();

            Assert.AreEqual(new DateTime(2015, 5, 5, 9, 4, 0), service.ParseDateTime("5.5.2015 9:4"));
            Assert.AreEqual(new DateTime(2015, 5, 5, 9, 40, 0), service.ParseDateTime("5.05.2015 9:40"));
            Assert.AreEqual(new DateTime(2015, 5, 5, 9, 4, 0), service.ParseDateTime("05.05.2015 09:04"));
            Assert.AreEqual(new DateTime(2015, 5, 10, 17, 4, 0), service.ParseDateTime("10.05.2015 17:04"));
            Assert.AreEqual(new DateTime(2015, 7, 8, 14, 57, 0), service.ParseDateTime("8.7.2015,  14:57 Uhr"));
        }
        public void Should_Parse_Html()
        {
            var service   = new TemperatureService();
            var testData1 = System.IO.File.ReadAllText("TestData/Temperature1.txt");

            var temperature = service.ParseHtml(testData1);

            Assert.AreEqual(17.31f, temperature.Swimmer);
            Assert.AreEqual(15.4f, temperature.NonSwimmer);
            Assert.AreEqual(15.0f, temperature.KidSplash);
        }
Esempio n. 8
0
		public void TestService ()
		{
			// Apache SOAP / RPC
		
			TemperatureService ts = new TemperatureService ();
			float temp = ts.getTemp ("95110");
			Assert.IsTrue (temp < 140 && temp > -60);
			
			temp = ts.getTemp ("hola");
			Assert.IsTrue (temp == -999);
		}
        public void Should_Parse_Temperature_Correctly()
        {
            var service = new TemperatureService();

            Assert.AreEqual(15.00f, service.ParseTemperature("15 °C"));
            Assert.AreEqual(15.00f, service.ParseTemperature("15 �C"));
            Assert.AreEqual(15.00f, service.ParseTemperature(" 15 �C"));

            Assert.AreEqual(15.57f, service.ParseTemperature("15,57 °C"));
            Assert.AreEqual(15.7f, service.ParseTemperature("15,7 °C"));
            Assert.AreEqual(5.71f, service.ParseTemperature("5,71 °C"));
        }
        public void Should_Get_Current_Temperature()
        {
            var service     = new TemperatureService();
            var temperature = service.Current();

            Assert.IsInstanceOf(typeof(ITemperatureService), service);
            Assert.NotNull(temperature);
            Assert.Greater(temperature.Swimmer, 0);
            Assert.Greater(temperature.NonSwimmer, 0);
            Assert.Greater(temperature.KidSplash, 0);
            Assert.NotNull(temperature.MeasuredAt);
        }
Esempio n. 11
0
 public static void Main(string[] args)
 {
     //pretend for a sec we can use ctrl-c
     while (true)
     {
         Console.Write("Type a city name to get current temperature: ");
         var input = Console.ReadLine();
         var temperatureService      = new TemperatureService();
         var temperatureReplyService = new TemperatureReplyService(temperatureService);
         Console.WriteLine(temperatureReplyService.GetTemperatureReply(input));
     }
 }
Esempio n. 12
0
        public void TestService()
        {
            // Apache SOAP / RPC

            TemperatureService ts = new TemperatureService();
            float temp            = ts.getTemp("95110");

            Assert.IsTrue(temp <140 && temp> -60);

            temp = ts.getTemp("hola");
            Assert.IsTrue(temp == -999);
        }
Esempio n. 13
0
        public MainView()
        {
            InitializeComponent();
            tempService = new TemperatureService();
            fileService = new FileService();

            Settings        = fileService.LoadSettingsFromFile();
            lbCity.Text     = Settings.City;
            InsideDataList  = new List <TempData>();
            OutsideDataList = new List <TempData>();
            NextInsideTemperature();
            NextOutsideTemperature();
        }
Esempio n. 14
0
        public void Time_45_Temperature_Should_Equal_60_Celcius()
        {
            // Arrange
            var          clock    = GetClock(45);
            var          service  = new TemperatureService(clock);
            const double expected = 60.0;

            // Act
            var result = service.GetTemperature();

            // Assert
            result.Should().Be(expected);
        }
        private void btnMessages_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                TemperatureService.SendMessageAsync(deviceClient).GetAwaiter();
            }

            catch { }
            finally
            {
                //lvRecieve.Item.Add();
                //lvRecieve.Text = $"The temperature is {temperatureModel.Temperature}";
            }
        }
Esempio n. 16
0
        public MainViewModel(IAssetLoader assets, TemperatureService temperatureService)
        {
            _assets             = assets;
            _temperatureService = temperatureService;
            _frames             = new[]
            {
                new Bitmap(_assets.Open(new Uri("avares://pidashboard/Assets/nyan-0.png", UriKind.Absolute))),
                new Bitmap(_assets.Open(new Uri("avares://pidashboard/Assets/nyan-1.png", UriKind.Absolute))),
                new Bitmap(_assets.Open(new Uri("avares://pidashboard/Assets/nyan-2.png", UriKind.Absolute))),
                new Bitmap(_assets.Open(new Uri("avares://pidashboard/Assets/nyan-3.png", UriKind.Absolute)))
            };

            EnvironmentalDataUpdater();
            CurrentTimeUpdater();
            DispatcherTimer.Run(EnvironmentalDataUpdater, TimeSpan.FromSeconds(30));
            DispatcherTimer.Run(CurrentTimeUpdater, TimeSpan.FromSeconds(1));
            DispatcherTimer.Run(NyanCatenator, TimeSpan.FromMilliseconds(150));
        }
Esempio n. 17
0
        public static void Main(string[] args)
        {
            var service     = new TemperatureService();
            var temperature = service.Current();

            if (temperature != null)
            {
                Console.WriteLine("Aktuelle Wasser-Temperatur im Freibad Marienhöhe:");
                Console.WriteLine();
                Console.WriteLine($"Schwimmer-, Sprungbecken          {temperature.Swimmer:F2} °C");
                Console.WriteLine($"Nichtschwimmer-, Rutschenbecken   {temperature.NonSwimmer:F2} °C");
                Console.WriteLine($"Kinderbecken                      {temperature.KidSplash:F2} °C");
                Console.WriteLine();
                Console.WriteLine($"Zuletzt aktualisiert {temperature.MeasuredAt.ToString(CultureInfo.GetCultureInfoByIetfLanguageTag("de"))}");
                Console.ReadLine();
            }
            else
            {
                Console.WriteLine("Huch, die aktuelle Wassertemperatur konnte leider nicht abgerufen werden.");
            }
        }
Esempio n. 18
0
        protected override void Execute() {
            ITemperature current = null;
            Temperature temperature = null;

            try {
                var service = new TemperatureService();
                current = service.Current();
            }
            catch (Exception ex) {
                Logger.Error("Could not receive current temperature from webservice!", ex);
                return;
            }

            try {
                temperature = Temperature.CreateFrom(current);
                SaveWhenNotAlreadyExists(temperature);
            }
            catch (Exception ex) {
                Logger.Error($"Could not save temperature to database! {temperature}", ex);
            }
        }
 public membertemperatureController(TemperatureService temperatureService, ServiceDBContext context)
 {
     _TemperatureService = temperatureService;
     _Context            = context;
 }
Esempio n. 20
0
 public TemperaturePage(TemperatureService service)
 {
     InitializeComponent();
     _service       = service;
     BindingContext = _service;
 }
Esempio n. 21
0
 public void Dispose()
 {
     _weatherAPI        = null;
     temperatureService = null;
 }
Esempio n. 22
0
 public TemperatureServiceShould()
 {
     _weatherAPI        = new Mock <IWeatherAPI>();
     temperatureService = new TemperatureService(_weatherAPI.Object);
 }
 public MembersController(MembersService membersService, TemperatureService temperatureService, ServiceDBContext context)
 {
     _MembersService     = membersService;
     _TemperatureService = temperatureService;
     _Context            = context;
 }
Esempio n. 24
0
 public ClientController(TemperatureService temperatureService)
 {
     _temperatureService = temperatureService;
 }
Esempio n. 25
0
 public TemperatureManager(TemperatureService service)
 {
     _service = service;
 }
Esempio n. 26
0
 // GET
 public IEnumerable <TemperatureEntry> Get()
 {
     return(TemperatureService.GetTempEntries());
 }
Esempio n. 27
0
 public HttpResponseMessage Post([FromBody] Double value)
 {
     TemperatureService.AddTempEntry(value);
     return(new HttpResponseMessage(HttpStatusCode.OK));
 }
Esempio n. 28
0
        private async Task <int> GetTemperatureBasedExtraMinutes()
        {
            var temperatureService = new TemperatureService();

            return(await temperatureService.GetTemperatureBasedExtraMinutes());
        }
Esempio n. 29
0
 public TemperatureDirectProvider(TemperatureService temperatureService)
 {
     this.temperatureService = temperatureService;
 }
Esempio n. 30
0
 public RaspiController(UserConfigurating userConfigurating, TemperatureService temperatureService)
 {
     _userConfigurating  = userConfigurating;
     _temperatureService = temperatureService;
 }