Exemplo n.º 1
0
        public IWriter <T> GetWriter <T>(DataSetInfo dataSetInfo)
        {
            var testWriter = new TestWriter <T>(dataSetInfo);

            Writers.Add(dataSetInfo, testWriter);
            return(testWriter);
        }
Exemplo n.º 2
0
        public TestWriter <T> GetOneWriterAndVerifyOthersAreEmpty <T>(string writerName, int expectedWriterCount)
        {
            Writers.Count.Should().Be(expectedWriterCount);
            TestWriter <T> testWriterToReturn = null;

            foreach (var(dataSetInfo, writer) in Writers)
            {
                if (dataSetInfo.Name == writerName)
                {
                    testWriterToReturn = writer as TestWriter <T>;
                    continue;
                }

                var dynamicWriter = (dynamic)writer;
                ((List <object>)dynamicWriter.ReceivedObjects).Count.Should().Be(0);
            }

            return(testWriterToReturn);
        }