Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Start HttpListener!");

            var Persister = new JsonPersister(getJsonFileWriter);

            if (System.IO.File.Exists(JsonFile))
            {
                using (var reader = new StreamReader(JsonFile)) Persister.ReadEntries(reader);
            }

            EntryRepository repo = new EntryRepository(Persister, Persister.AllEntries());

            LogService ls = new LogService(repo);

            ls.StartService("http://*:8080/");

            Console.WriteLine("Service started, press key to terminate!");
            Console.ReadKey(true);
        }
Ejemplo n.º 2
0
        public void ReadEntries_from_empty_Textreader_returns_empty_Array()
        {
            persister.ReadEntries(new StringReader(""));

            Assert.AreEqual(0, persister.AllEntries().Count());
        }