コード例 #1
0
 //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();
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 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);
 }
コード例 #4
0
		//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();
		}