Beispiel #1
0
        public void Test_FileDataProvider_Loop()
        {
            var loop = new Loop()
            {
                Id = 1
            };

            loop.Inner = loop;

            var fdp = new FileDataProvider()
            {
                DirectoryPath   = _directory,
                FilenameBuilder = x => x.EventType
            };

            Configuration.DataProvider = fdp;
            var guid = "x" + Guid.NewGuid().ToString();

            new AuditScopeFactory().Log(guid, loop);

            var ev = fdp.GetEvent(Path.Combine(_directory, guid));

            Assert.IsNotNull(ev);
            Assert.AreEqual(guid, ev.EventType);
            Assert.AreEqual(2, ev.CustomFields.Count);
            Assert.AreEqual(1, ev.CustomFields["Id"]);
            Assert.AreEqual("{\r\n  \"Id\": 1\r\n}", ev.CustomFields["Inner"].ToString());
        }