예제 #1
0
        public void ProgammableClockInitialValue()
        {
            FixedClock clock = new FixedClock(new DateTime(2013, 7, 28, 14, 08, 30));

            Assert.AreEqual("28/07/2013 14:08:30", clock.Now().ToString());
            Assert.AreEqual("28/07/2013 00:00:00", clock.Today().ToString());
        }
예제 #2
0
        public void ProgammableClockDefaultValue()
        {
            FixedClock clock = new FixedClock();

            Assert.AreEqual("01/01/0001 00:00:00", clock.Now().ToString());
            Assert.AreEqual("01/01/0001 00:00:00", clock.Today().ToString());
        }
예제 #3
0
        public void ShouldReturnProvidedDateTimeOffset()
        {
            DateTimeOffset dto   = new DateTimeOffset(1978, 1, 1, 2, 3, 4, TimeSpan.FromHours(2));
            Clock          clock = new FixedClock(dto);

            Assert.That(clock.Now, Is.EqualTo(dto));
        }
예제 #4
0
        public void ProgammableClockForward()
        {
            FixedClock clock = new FixedClock(new DateTime(2013, 7, 28, 14, 08, 30));

            clock.Forward(2);
            Assert.AreEqual("30/07/2013 14:08:30", clock.Now().ToString());
            Assert.AreEqual("30/07/2013 00:00:00", clock.Today().ToString());
        }
예제 #5
0
 public override bool Equals(Object obj)
 {
     if (obj is FixedClock)
     {
         FixedClock other = (FixedClock)obj;
         return(Instant_Renamed.Equals(other.Instant_Renamed) && Zone_Renamed.Equals(other.Zone_Renamed));
     }
     return(false);
 }
예제 #6
0
        public void ProgammableClockSetClock()
        {
            FixedClock clock = new FixedClock();

            clock.SetClock(new DateTime(2014, 7, 28, 14, 08, 30));

            Assert.AreEqual("28/07/2014 14:08:30", clock.Now().ToString());
            Assert.AreEqual("28/07/2014 00:00:00", clock.Today().ToString());
        }
예제 #7
0
        IEnumerator <WaitCommand> OnEnter()
        {
            FixedClock.PausePhysics();
            _data.SoundMixer.Pause(SoundLayer.GameEffects);

            OnResume(Maybe <RespawnRequest> .Nothing, transitToParachuteEditor: false);
            var cameraTransform = _data.CameraManager.Rig.transform.MakeImmutable();

            _spectatorCameraMount.transform.Set(cameraTransform);
            _data.CameraManager.SwitchMount(_spectatorCameraMount);

            yield return(WaitCommand.WaitForNextFrame);
        }
        public void ValidateDates()
        {
            var process = new BatchProcessDefinition();
            var today   = new DateTime(2000, 1, 1);
            var clock   = new FixedClock(today);

            process.Clock = clock;
            Assert.IsNull(process.Validate(today, null));
            Assert.IsNull(process.Validate(today.AddDays(1), null));
            Assert.IsNotNull(process.Validate(today.AddDays(-1), null));

            Assert.IsNull(process.Validate(today, today));
            Assert.IsNotNull(process.Validate(today.AddDays(1), today));
            Assert.IsNull(process.Validate(today.AddDays(3), today.AddDays(4)));
        }
예제 #9
0
        private void SetUpGet()
        {
            httpGetParam = new HttpParameterSet()
            {
                ConsumerKey     = "consumerKey",
                ConsumerSecret  = "consumerSecret",
                Token           = "token",
                TokenSecret     = "tokenSecret",
                OAuthVersion    = "1.0",
                RequestMethod   = "GET",
                SignatureMethod = "HMAC-SHA1",
                Url             = "http://www.gant.com/test?first=value1&second=value2"
            };

            fixedStringGet = new FixedStringGenerator(GET_NONCE);
            fixedClockGet  = new FixedClock(GET_TIMESTAMP);

            signedGetRequest = new OpenedSignedParameterSet10(httpGetParam, fixedStringGet, fixedClockGet);
        }
예제 #10
0
        public void Test()
        {
            const long correction = 100;

            long now = DateTime.UtcNow.Ticks;

            var f = new FixedClock(new DateTime(now,DateTimeKind.Utc));

            var c = new CompensatedClock(f, correction);

            Assert.AreEqual(c.UtcNow, f.FixedValue);

            f.FixedValue = new DateTime(now + TimeSpan.TicksPerDay, DateTimeKind.Utc);

            Assert.AreEqual(c.UtcNow, new DateTime(now + TimeSpan.TicksPerDay + correction));

            f.FixedValue = new DateTime(now + TimeSpan.TicksPerDay + TimeSpan.TicksPerDay, DateTimeKind.Utc);

            Assert.AreEqual(c.UtcNow, new DateTime(now + TimeSpan.TicksPerDay + TimeSpan.TicksPerDay + correction + correction));
        }
예제 #11
0
        private IEnumerator <WaitCommand> OnEnter()
        {
            _isRunning       = true;
            Cursor.lockState = CursorLockMode.Locked;
            Cursor.visible   = false;

            FixedClock.ResumePhysics();

            _data.NotificationRenderer.gameObject.SetActive(false);

            _data.MusicPlayer.StopAndFade();
            _data.MusicPlayer.PlayIntro();

            var titlescreenMount = _data.CameraMount.GetComponent <ICameraMount>();

            _data.CameraManager.SwitchMount(titlescreenMount);
            _data.CoroutineScheduler.Run(_data.Animator.Animate(titlescreenMount.transform, () => _isRunning));
            _logoFadeIn = _data.CoroutineScheduler.Run(LogoFadeIn());

            _data.CameraManager.Rig.ScreenFader.Opacity = 1f;
            yield return(_data.CameraManager.Rig.ScreenFader.FadeIn(_data.GameClock, _data.FaderSettings)
                         .AsWaitCommand());
        }
        private void SetUpGet()
        {
            httpGetParam = new HttpParameterSet()
            {
                ConsumerKey = "consumerKey",
                ConsumerSecret = "consumerSecret",
                Token = "token",
                TokenSecret = "tokenSecret",
                OAuthVersion = "1.0",
                RequestMethod = "GET",
                SignatureMethod = "HMAC-SHA1",
                Url = "http://www.gant.com/test?first=value1&second=value2"
            };

            fixedStringGet = new FixedStringGenerator(GET_NONCE);
            fixedClockGet = new FixedClock(GET_TIMESTAMP);

            signedGetRequest = new OpenedSignedParameterSet10(httpGetParam, fixedStringGet, fixedClockGet);
        }