コード例 #1
0
        public void TestDoesNotExist()
        {
            _source = Create(_fname);
            _taskScheduler.RunOnce();
            _source.GetProperty(Properties.EmptyReason).Should().Be(null);
            _source.GetProperty(Properties.Created).Should().NotBe(DateTime.MinValue);

            _streamWriter?.Dispose();
            _stream?.Dispose();
            File.Delete(_fname);
            _taskScheduler.RunOnce();

            _source.GetProperty(Properties.EmptyReason).Should().BeOfType <SourceDoesNotExist>();
            _source.GetProperty(Properties.Created).Should().BeNull();
        }
コード例 #2
0
        public void TestConstruction()
        {
            _source.Columns.Should().Equal(new IColumnDescriptor[]
            {
                Columns.Index,
                Columns.OriginalIndex,
                Columns.LogEntryIndex,
                Columns.LineNumber,
                Columns.OriginalLineNumber,
                Columns.OriginalDataSourceName,
                Columns.RawContent,
                PageBufferedLogSource.RetrievalState
            });

            _streamWriter.Write("Foo");
            _streamWriter.Flush();

            var info = new FileInfo(_fname);

            _taskScheduler.RunOnce();

            _source.GetProperty(Properties.LastModified).Should().Be(info.LastWriteTimeUtc);
            _source.GetProperty(Properties.Created).Should().Be(info.CreationTimeUtc);
        }