Exemplo n.º 1
0
        public async Task TestLogExplicitName_Async()
        {
            const string expectedLogName = "MyLog";

            var target = new LoggedAsyncMockA();

            await target.OtherAsync();

            Assert.AreEqual(2, logList.Logs.Count);
            Assert.AreEqual(expectedLogName, logList.Logs[0].GetLogName());
            Assert.AreEqual(expectedLogName, logList.Logs[1].GetLogName());
        }
Exemplo n.º 2
0
        public async Task TestLogAutoName_Async()
        {
            const string expectedLogName = "PubComp.Aspects.Monitoring.UnitTests.LogMocks.LoggedAsyncMockA";

            var target = new LoggedAsyncMockA();

            try
            {
                await target.ThrowSomethingAsync();
            }
            catch (ApplicationException)
            {
            }

            Assert.AreEqual(2, logList.Logs.Count);
            Assert.AreEqual(expectedLogName, logList.Logs[0].GetLogName());
            Assert.AreEqual(expectedLogName, logList.Logs[1].GetLogName());
        }
Exemplo n.º 3
0
        public async Task TestLogEntryException_Async_AspectOnMethod()
        {
            var target = new LoggedAsyncMockA();

            await TestLogEntryExceptionAsync(target);
        }