Exemplo n.º 1
0
        public void Verify_basic_send_capabilities()
        {
            var sut = new TestSignedCommunicationChannel(_config);

            sut.SendOpenPortRequest(new OpenPortRequest(1234, DateTime.Now, "10.0.0.1"), "SignPassword");
            Assert.That(sut.SentData, Is.Not.Null);
        }
Exemplo n.º 2
0
        public void Unknown_port_generates_security_exception()
        {
            DateTime expectedDate = new DateTime(2010, 10, 10);
            var      sut          = new TestSignedCommunicationChannel(_config);

            Assert.Throws <SecurityException>(() =>
                                              sut.SendOpenPortRequest(new OpenPortRequest(555555, expectedDate, "10.0.0.1"), "SignPassword"));
        }
Exemplo n.º 3
0
        public void Verify_send_then_receive()
        {
            DateTime expectedDate = new DateTime(2010, 10, 10);
            var      sut          = new TestSignedCommunicationChannel(_config);

            sut.SendOpenPortRequest(new OpenPortRequest(1234, expectedDate, "10.0.0.1"), "SignPassword");
            Assert.That(sut.ReceivedRequest.EndOpeningDate, Is.EqualTo(expectedDate));
            Assert.That(sut.ReceivedRequest.PortToOpen, Is.EqualTo(1234));
        }