public void Should_Add_Transport()
 {
     var transportSection = new MessageTransportConfigurationSection();
     var transport = Substitute.For<IMessageTransport>();
     transportSection.Add(transport);
     Assert.AreEqual(transportSection.TransportCount, 1);
 }
        public void Should_Parse_Transport_Names()
        {
            var transportSection = new MessageTransportConfigurationSection();

            //Arrange
            var transports = Substitute.For<XmlTag>();
            var enumerable = Substitute.For<IEnumerable<XmlTag>>();
            transports.Elements().Returns(enumerable);
            var transport = Substitute.For<XmlTag>();
            transport.Name.Returns("facebook");
            var actual = new List<XmlTag>{ transport };
            var enumerator = actual.GetEnumerator();
            enumerable.GetEnumerator().Returns(enumerator);

            //Act
            transportSection.ParseTransportsFromXml(transports);

            //Assert
            enumerable.Received().GetEnumerator();
            var name = transport.Received().Name; //Need to do assignment here to make compiler smile.
        }
 public void Should_Return_List_Of_Transports_From_Transports()
 {
     var transportSection = new MessageTransportConfigurationSection();
     Assert.IsTrue(transportSection.Transports.Count > 0);
 }