Ejemplo n.º 1
0
        public void with_writers_and_the_writers_are_added_at_the_beginning_of_the_writer_enumerable()
        {
            var WriterDef1  = new ObjectDef(typeof(StubAddressWriter));
            var WriterNode1 = MockRepository.GenerateMock <IMediaWriterNode>();

            WriterNode1.Stub(x => x.InputType).Return(typeof(Address));
            WriterNode1.Stub(x => x.ToObjectDef(DiagnosticLevel.None)).Return(WriterDef1);
            theOutputNode.AddWriter(WriterNode1);

            var WriterDef2  = new ObjectDef(typeof(StubAddressWriter));
            var WriterNode2 = MockRepository.GenerateMock <IMediaWriterNode>();

            WriterNode2.Stub(x => x.InputType).Return(typeof(Address));
            WriterNode2.Stub(x => x.ToObjectDef(DiagnosticLevel.None)).Return(WriterDef2);
            theOutputNode.AddWriter(WriterNode2);


            theReaderDependencies.Count().ShouldEqual(3);
            theReaderDependencies.ElementAt(0).ShouldBeTheSameAs(WriterDef1);
            theReaderDependencies.ElementAt(1).ShouldBeTheSameAs(WriterDef2);
        }
Ejemplo n.º 2
0
        public void throw_argument_exception_if_media_reader_node_type_is_wrong()
        {
            var Writer = MockRepository.GenerateMock <IMediaWriterNode>();

            Writer.Stub(x => x.InputType).Return(GetType());

            var node = new ConnegOutputNode(typeof(Address));

            Exception <ArgumentException> .ShouldBeThrownBy(() =>
            {
                node.AddWriter(Writer);
            });
        }