コード例 #1
0
		public void WeatherManager_RegisterRegion_ReturnRegion()
		{
			var weatherMgr = new WeatherManager(new SimpleScheduler());
			
			var region = FakeRegion();
			weatherMgr.RegisterRegion(region);
			
			Assert.AreEqual(weatherMgr[1].Region, region);
		}
コード例 #2
0
		public void WeatherManager_UnRegisterRegion_ReturnNull()
		{
			var weatherMgr = new WeatherManager(new SimpleScheduler());
			
			var region = FakeRegion();
			weatherMgr.RegisterRegion(region);
			weatherMgr.UnRegisterRegion(region);
			
			Assert.IsNull(weatherMgr[1]);
		}
コード例 #3
0
		public void WeatherManager_StopWeatherRegion_StartTime()
		{
			var weatherMgr = new WeatherManager(new SimpleScheduler());
			
			var region = FakeRegion();
			weatherMgr.RegisterRegion(region);
			
			weatherMgr.StartWeather(1);
			weatherMgr.StopWeather(1);
			Assert.AreEqual(0, weatherMgr[1].StartTime);
		}
コード例 #4
0
		public void WeatherManager_ChangeWeatherRegionException_WeatherEqual()
		{
			var weatherMgr = new WeatherManager(new SimpleScheduler());
			
			var region = FakeRegion();
			weatherMgr.RegisterRegion(region);
			
			weatherMgr.ChangeWeather(1, weather => { weather.CreateWeather(65000, 300, 100, 16000, 0); throw new Exception(); });

			Assert.AreEqual((65535 + 65000) / 300, weatherMgr[1].Duration / 1000);
			Assert.AreEqual(65000, weatherMgr[1].Width);
		}
コード例 #5
0
		public void WeatherManager_StopWeatherRegion_ReturnTrue()
		{
			var weatherMgr = new WeatherManager(new SimpleScheduler());
			
			var region = FakeRegion();
			weatherMgr.RegisterRegion(region);
			
			weatherMgr.StartWeather(1);
			Assert.IsTrue(weatherMgr.StopWeather(1));
		}