Exemplo n.º 1
0
        public void ThreeValidItemsThreeInvalidItems_Process_ReturnsThreeResults()
        {
            IEnumerable <Item> items = new Item[]
            {
                new Item()
                {
                    IsFoo = true
                },
                new Item()
                {
                    IsFoo = false
                },
                new Item()
                {
                    IsFoo = true
                },
                new Item()
                {
                    IsFoo = false
                },
                new Item()
                {
                    IsFoo = true
                },
                new Item()
                {
                    IsFoo = false
                }
            };
            var proc = new FooProcessor();

            IEnumerable <FooItem> result = proc.ProcessFoos(items);

            Assert.AreEqual(3, result.Count());
        }
Exemplo n.º 2
0
        public void NullItems_Process_Throws()
        {
            IEnumerable <Item> items = null;
            var proc = new FooProcessor();

            proc.ProcessFoos(items);
        }
Exemplo n.º 3
0
        public void EmptyItems_Process_ReturnsEmptyResults()
        {
            IEnumerable <Item> items = new Item[] {};
            var proc = new FooProcessor();

            IEnumerable <FooItem> result = proc.ProcessFoos(items);

            Assert.IsNotNull(result);
            Assert.AreEqual(0, result.Count());
        }
Exemplo n.º 4
0
    public IProcessor GetProcessor(object settings)
    {
        IProcessor p = null;

        if (settings is BarSettings)
        {
            p = new BarProcessor(settings as BarSettings);
        }
        else if (settings is FooSettings)
        {
            p = new FooProcessor(settings as FooSettings);
        }
        return(p);
    }
Exemplo n.º 5
0
        public void OneValidItem_Process_ReturnsOneResult()
        {
            IEnumerable <Item> items = new Item[]
            {
                new Item()
                {
                    IsFoo = true
                }
            };
            var proc = new FooProcessor();

            IEnumerable <FooItem> result = proc.ProcessFoos(items);

            Assert.AreEqual(1, result.Count());
        }
Exemplo n.º 6
0
 void Foo <FooChild> .Process(FooProcessor <FooChild> processor)
 {
     this.Process((FooProcessorFooChild)processor);
 }