//ncrunch: no coverage start
 protected internal DeveloperOnlineContentLoader(OnlineServiceConnection connection)
 {
     this.connection = connection;
     connection.loadContentMetaData += OnLoadContentMetaData;
     connection.DataReceived += OnDataReceived;
     if (!connection.IsConnected)
         connection.ConnectToService();
     if (connection.IsLoggedIn)
         SendCheckProjectContent();
 }
 public void ReceiveResultFromServer()
 {
     var connection = new OnlineServiceConnection(new MockSettings(), () => {});
     object lastMessageReceived = null;
     string errorReceived = "";
     connection.ServerErrorHappened += text => errorReceived = text;
     connection.DataReceived += message => lastMessageReceived = message;
     Assert.IsNull(lastMessageReceived);
     connection.ConnectToService();
     Thread.Sleep(1000);
     Assert.AreEqual("", errorReceived);
     Assert.IsNotNull(lastMessageReceived);
 }
 public void ClientGetsConnectedAndSendsLoginRequest()
 {
     string errorReceived = "";
     bool readyReceived = false;
     var connection = new OnlineServiceConnection(new MockSettings(), () => {});
     connection.ServerErrorHappened += text => errorReceived = text;
     connection.ContentReady += () => readyReceived = true;
     connection.ConnectToService();
     Thread.Sleep(1000);
     Assert.AreEqual("", errorReceived);
     Assert.IsTrue(connection.IsLoggedIn);
     Assert.IsTrue(readyReceived);
 }
		//ncrunch: no coverage start
		protected internal DeveloperOnlineContentLoader(OnlineServiceConnection connection)
		{
			this.connection = connection;
			if (StackTraceExtensions.StartedFromNCrunchOrNunitConsole &&
				File.Exists(ContentMetaDataFilePath) && IsContentMetaDataYoungerThanOneMinute())
				return;
			StartedToRequestOnlineContent = true;
			connection.loadContentMetaData += OnLoadContentMetaData;
			connection.DataReceived += OnDataReceived;
			if (!connection.IsConnected)
				connection.ConnectToService();
			if (connection.IsLoggedIn)
				SendCheckProjectContent();
		}