예제 #1
0
        public void GetLogEntryValues_GivenLogEntry_ExpectCorrectResult_NewFormat()
        {
            //------------Setup for test--------------------------
            const string logEntry        = @"2017-07-13 10:16:55,613 DEBUG - [03659971-6b50-42e7-af3e-1177fc2e86ed] - Mapping Inputs from Environment";
            var          dataServiceBase = new LogDataServiceBase();

            //---------------Assert Precondition----------------
            Assert.AreEqual(dataServiceBase.GetAuthorizationContextForService(), AuthorizationContext.Administrator);
            //------------Execute Test---------------------------
            var privateObject = new PrivateObject(dataServiceBase);
            var invoke        = (string[])privateObject.Invoke("GetLogEntryValues", BindingFlags.NonPublic | BindingFlags.Instance, logEntry);

            Assert.AreEqual(5, invoke.Length);
        }
예제 #2
0
        public void GetLogEntryValues_GivenLogEntry_ExpectCorrectResult()
        {
            //------------Setup for test--------------------------
            const string logEntry        = @"2017-07-13 08:02:52,799 DEBUG - [52cea226-d594-49eb-9c37-0598bd2803f5] - Request URL [ http://RSAKLFPETERB:3142/Examples\Loop Constructs - Select and Apply.XML ]";
            var          dataServiceBase = new LogDataServiceBase();

            //---------------Assert Precondition----------------
            Assert.AreEqual(dataServiceBase.GetAuthorizationContextForService(), AuthorizationContext.Administrator);
            //------------Execute Test---------------------------
            var privateObject = new PrivateObject(dataServiceBase);
            var invoke        = (string[])privateObject.Invoke("GetLogEntryValues", BindingFlags.NonPublic | BindingFlags.Instance, logEntry);

            Assert.AreEqual(5, invoke.Length);
        }