Exemple #1
0
        public void BasicWriterSelectorTest(bool w1, bool w2, bool expected)
        {
            var nw1 = SetupNodeWriter(w1, "1");
            var nw2 = SetupNodeWriter(w2, "2");

            var writerSelector = new WriterSelector(nw1, nw2);
            var resText        = string.Empty;

            var res = writerSelector.SelectAndProcessWriter(null, (s) => resText = s);

            Assert.Equal(expected, res);
            if (w1)
            {
                Assert.Equal("1", resText);
            }
            else if (w2)
            {
                Assert.Equal("2", resText);
            }
            else
            {
                Assert.Equal(string.Empty, resText);
            }
        }
Exemple #2
0
        public void EmptyWriterSelectorTest()
        {
            var writerSelector = new WriterSelector();

            Assert.False(writerSelector.SelectAndProcessWriter(null, (s) => { }));
        }