public void OfType_ShouldThrowArgumentNullExceptionWhenNoDataIsLoaded() { var request = new RequestSshData(); try { request.OfType <ReplySshData>(); Assert.Fail(); } catch (ArgumentNullException ex) { Assert.IsNull(ex.InnerException); Assert.AreEqual("data", ex.ParamName); } }
public void Load_Data_ShouldThrowArgumentNullExceptionWhenDataIsNull() { const byte[] sshData = null; var request = new RequestSshData(); try { request.Load(sshData); Assert.Fail(); } catch (ArgumentNullException ex) { Assert.IsNull(ex.InnerException); Assert.AreEqual("data", ex.ParamName); } }
public void Load_Data() { const uint one = 123456u; const uint two = 456789u; var sshDataStream = new SshDataStream(8); sshDataStream.Write(one); sshDataStream.Write(two); var sshData = sshDataStream.ToArray(); var request = new RequestSshData(); request.Load(sshData); Assert.AreEqual(one, request.ValueOne); Assert.AreEqual(two, request.ValueTwo); }
public void Load_DataAndOffsetAndCount() { const uint one = 123456u; const uint two = 456789u; var sshDataStream = new SshDataStream(11); sshDataStream.WriteByte(0x05); sshDataStream.WriteByte(0x07); sshDataStream.WriteByte(0x0f); sshDataStream.Write(one); sshDataStream.Write(two); var sshData = sshDataStream.ToArray(); var request = new RequestSshData(); request.Load(sshData, 3, sshData.Length - 3); Assert.AreEqual(one, request.ValueOne); Assert.AreEqual(two, request.ValueTwo); }
public void OfType() { const uint one = 123456u; const uint two = 456789u; var sshDataStream = new SshDataStream(8); sshDataStream.Write(one); sshDataStream.Write(two); var sshData = sshDataStream.ToArray(); var request = new RequestSshData(); request.Load(sshData); var reply = request.OfType <ReplySshData>(); Assert.IsNotNull(reply); Assert.AreEqual(one, reply.ValueOne); }
public void OfType_LoadWithOffset() { const uint one = 123456u; const uint two = 456789u; var sshDataStream = new SshDataStream(11); sshDataStream.WriteByte(0x05); sshDataStream.WriteByte(0x07); sshDataStream.WriteByte(0x0f); sshDataStream.Write(one); sshDataStream.Write(two); var sshData = sshDataStream.ToArray(); var request = new RequestSshData(); request.Load(sshData, 3, sshData.Length - 3); var reply = request.OfType <ReplySshData>(); Assert.IsNotNull(reply); Assert.AreEqual(one, reply.ValueOne); }
public void OfType() { const uint one = 123456u; const uint two = 456789u; var sshDataStream = new SshDataStream(8); sshDataStream.Write(one); sshDataStream.Write(two); var sshData = sshDataStream.ToArray(); var request = new RequestSshData(); request.Load(sshData); var reply = request.OfType<ReplySshData>(); Assert.IsNotNull(reply); Assert.AreEqual(one, reply.ValueOne); }
public void OfType_ShouldThrowArgumentNullExceptionWhenNoDataIsLoaded() { var request = new RequestSshData(); try { request.OfType<ReplySshData>(); Assert.Fail(); } catch (ArgumentNullException ex) { Assert.IsNull(ex.InnerException); Assert.AreEqual("data", ex.ParamName); } }
public void OfType_LoadWithOffset() { const uint one = 123456u; const uint two = 456789u; var sshDataStream = new SshDataStream(11); sshDataStream.WriteByte(0x05); sshDataStream.WriteByte(0x07); sshDataStream.WriteByte(0x0f); sshDataStream.Write(one); sshDataStream.Write(two); var sshData = sshDataStream.ToArray(); var request = new RequestSshData(); request.Load(sshData, 3, sshData.Length - 3); var reply = request.OfType<ReplySshData>(); Assert.IsNotNull(reply); Assert.AreEqual(one, reply.ValueOne); }