public void StartStopDisposeShouldWork()
 {
     var reynaService = new ReynaService(false, this.Logger.Object);
     Assert.Null(reynaService.NetworkStateService);
     reynaService.Start();
     System.Threading.Thread.Sleep(1000);
     reynaService.Stop();
     reynaService.Stop();
     reynaService.Stop();
     reynaService.Dispose();
     reynaService.Dispose();
     reynaService.Dispose();
 }
        public void StartStopDisposeShouldWork()
        {
            var reynaService = new ReynaService(null, null, false, this.Logger.Object);

            Assert.Null(reynaService.NetworkStateService);
            reynaService.Start();
            System.Threading.Thread.Sleep(1000);
            reynaService.Stop();
            reynaService.Stop();
            reynaService.Stop();
            reynaService.Dispose();
            reynaService.Dispose();
            reynaService.Dispose();
        }
        public void WhenConstructingWithUseNetworkStateIsFalseShouldNotUseNetworkStateService()
        {
            var reynaService = new ReynaService(null, null, false, this.Logger.Object);

            Assert.Null(reynaService.NetworkStateService);
            reynaService.Dispose();
        }
        public void WhenConstructingWithUseNetworkStateIsFalseAndHasOtherArgsShouldNotUseNetworkStateService()
        {
            var password     = new byte[] { 0xFF, 0xAA, 0xCC, 0xCC };
            var reynaService = new ReynaService(password, null, false, this.Logger.Object);

            Assert.Null(reynaService.NetworkStateService);
            Assert.Equal(password, ((SQLiteRepository)reynaService.PersistentStore).Password);
            reynaService.Dispose();
        }
 public void WhenCallingDisposeAndServicesAreNullShouldNotDisposeServices()
 {
     var helper = new TestUnityHelper();
     var container = helper.GetContainer();
     ReynaService service = new ReynaService(null, container);
     service.StoreService = null;
     service.ForwardService = null;
     service.NetworkStateService = null;
     service.Dispose();
     helper.mockStoreService.Verify(s => s.Dispose(), Times.Never);
     helper.mockForwardService.Verify(s => s.Dispose(), Times.Never);
     helper.mockNetworkStateService.Verify(s => s.Dispose(), Times.Never);
 }
 public void WhenConstructingWithUseNetworkStateIsTrueShouldUseNetworkStateService()
 {
     var reynaService = new ReynaService(null, null, true, this.Logger.Object);
     Assert.NotNull(reynaService.NetworkStateService);
     reynaService.Dispose();
 }
 public void WhenConstructingWithUseNetworkStateIsFalseAndHasOtherArgsShouldNotUseNetworkStateService()
 {
     var password = new byte[] { 0xFF, 0xAA, 0xCC, 0xCC };
     var reynaService = new ReynaService(password, null, false, this.Logger.Object);
     Assert.Null(reynaService.NetworkStateService);
     Assert.Equal(password, ((SQLiteRepository)reynaService.PersistentStore).Password);
     reynaService.Dispose();
 }
 public void WhenConstructingWithUseNetworkStateIsFalseShouldNotUseNetworkStateService()
 {
     var reynaService = new ReynaService(false, this.Logger.Object);
     Assert.Null(reynaService.NetworkStateService);
     reynaService.Dispose();
 }