Beispiel #1
0
        public void CutLog_LogSize()
        {
            IGlobalSettingsStorageProviderV40 prov = GetProvider();

            //Collectors.SettingsProvider = prov;

            for (int i = 0; i < 100; i++)
            {
                prov.LogEntry("Test", EntryType.General, "User", null);
                prov.LogEntry("Test", EntryType.Error, "User", "wiki1");
                prov.LogEntry("Test", EntryType.Warning, "User", "");
            }

            Assert.IsTrue(prov.LogSize > 0 && prov.LogSize < MaxLogSize, "Wrong size");

            Assert.IsTrue(prov.GetLogEntries().Length < 300, "Wrong log entry count");
        }
Beispiel #2
0
        public void LogEntry_InvalidMessage(string m, string w)
        {
            IGlobalSettingsStorageProviderV40 prov = GetProvider();

            //Collectors.SettingsProvider = prov;

            prov.LogEntry(m, EntryType.General, "NUnit", w);
        }
Beispiel #3
0
        public void LogEntry_InvalidUser(string u, string w)
        {
            IGlobalSettingsStorageProviderV40 prov = GetProvider();

            //Collectors.SettingsProvider = prov;

            prov.LogEntry("Test", EntryType.General, u, w);
        }
Beispiel #4
0
        public void LogEntry_GetLogEntries(string m, EntryType t, string u, string w)
        {
            IGlobalSettingsStorageProviderV40 prov = GetProvider();

            //Collectors.SettingsProvider = prov;

            prov.LogEntry(m, t, u, w);

            LogEntry[] entries = prov.GetLogEntries();
            Assert.AreEqual(m, entries[entries.Length - 1].Message, "Wrong message");
            Assert.AreEqual(t, entries[entries.Length - 1].EntryType, "Wrong entry type");
            Assert.AreEqual(u, entries[entries.Length - 1].User, "Wrong user");
        }
Beispiel #5
0
        public void ClearLog()
        {
            IGlobalSettingsStorageProviderV40 prov = GetProvider();

            //Collectors.SettingsProvider = prov;

            prov.LogEntry("Test", EntryType.General, "User", null);
            prov.LogEntry("Test", EntryType.Error, "User", null);
            prov.LogEntry("Test", EntryType.Warning, "User", null);
            prov.LogEntry("Test", EntryType.General, "User", "wiki1");
            prov.LogEntry("Test", EntryType.Error, "User", "wiki1");
            prov.LogEntry("Test", EntryType.Warning, "User", "wiki1");

            Assert.AreEqual(6, prov.GetLogEntries().Length, "Wrong log entry count");

            prov.ClearLog();

            Assert.AreEqual(0, prov.GetLogEntries().Length, "Wrong log entry count");
        }