public void Verify_basic_send_capabilities() { var sut = new TestSymmetricCommunicationChannel(_config); sut.SendOpenPortRequest(new OpenPortRequest(1234, DateTime.Now, "10.0.0.1"), "secure password"); Assert.That(sut.SentData, Is.Not.Null); }
public void Wrong_password_generates_security_exception() { DateTime expectedDate = new DateTime(2010, 10, 10); var sut = new TestSymmetricCommunicationChannel(_config); Assert.Throws <SecurityException>(() => sut.SendOpenPortRequest(new OpenPortRequest(1234, expectedDate, "10.0.0.1"), "Wrong password")); }
public void Verify_send_then_receive() { DateTime expectedDate = new DateTime(2010, 10, 10); var sut = new TestSymmetricCommunicationChannel(_config); sut.SendOpenPortRequest(new OpenPortRequest(1234, expectedDate, "10.0.0.1"), "secure password"); Assert.That(sut.ReceivedRequest.EndOpeningDate, Is.EqualTo(expectedDate)); Assert.That(sut.ReceivedRequest.PortToOpen, Is.EqualTo(1234)); }