public void ResetEventIsSetOnInitFailed()
        {
            var target = new BeaconSendingContext(config, clientProvider, timingProvider);

            target.InitCompleted(false);
            var actual = target.WaitForInit();

            Assert.That(actual, Is.False);
        }
Exemple #2
0
        public void ResetEventIsSetOnInitSuccess()
        {
            var target = new BeaconSendingContext(logger, config, clientProvider, timingProvider);

            target.InitCompleted(true);
            var actual = target.WaitForInit();

            Assert.That(actual, Is.True);
        }
        public void IsInitializedOnInitSuccess()
        {
            // given
            var target = new BeaconSendingContext(config, clientProvider, timingProvider);

            target.InitCompleted(true);

            // when, then
            Assert.That(target.IsInitialized, Is.True);
        }
Exemple #4
0
        public void IsInitializedOnInitFailed()
        {
            // given
            var target = new BeaconSendingContext(logger, config, clientProvider, timingProvider);

            target.InitCompleted(false);

            // when, then
            Assert.That(target.IsInitialized, Is.False);
        }
        public void WaitForInitWhenWithTimeoutFailed()
        {
            // given
            var target = new BeaconSendingContext(config, clientProvider, timingProvider);

            target.InitCompleted(false);

            // when waiting for init completion with a timeout of 1ms
            var obtained = target.WaitForInit(1);

            // then the result must be false, since init was never set, but timeout expired
            Assert.That(obtained, Is.False);
        }