コード例 #1
0
        public void NewDataReceivedTest()
        {
            string testString = "The big black dog ate the small white cat";
            EncodedConnectionMock connection = new EncodedConnectionMock();
            byte[] data = connection.Encoding.GetBytes(testString);

            connection.OnEncodedDataReceived += (object sender, EncodedDataReceivedEventArgs eventArgs) =>
            {
                Assert.AreEqual(testString, eventArgs.EncodedData);
            };
            connection.SimulateReceivement(data);
        }
コード例 #2
0
 public void NewDataReceived_EventIsNullTest()
 {
     EncodedConnectionMock mock = new EncodedConnectionMock();
     mock.SimulateReceivement(null);
 }
コード例 #3
0
 public void ConstructorTest()
 {
     EncodedConnectionMock connection = new EncodedConnectionMock();
     Assert.IsNotNull(connection.Encoding);
 }