LEFT | RIGHT |
(no file at all) | |
1 /* | 1 /* |
2 Copyright 2011 Google Inc | 2 Copyright 2011 Google Inc |
3 | 3 |
4 Licensed under the Apache License, Version 2.0 (the "License"); | 4 Licensed under the Apache License, Version 2.0 (the "License"); |
5 you may not use this file except in compliance with the License. | 5 you may not use this file except in compliance with the License. |
6 You may obtain a copy of the License at | 6 You may obtain a copy of the License at |
7 | 7 |
8 http://www.apache.org/licenses/LICENSE-2.0 | 8 http://www.apache.org/licenses/LICENSE-2.0 |
9 | 9 |
10 Unless required by applicable law or agreed to in writing, software | 10 Unless required by applicable law or agreed to in writing, software |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 public void RegisterLoggerTest() | 85 public void RegisterLoggerTest() |
86 { | 86 { |
87 // Initialize with a NullLogger: | 87 // Initialize with a NullLogger: |
88 Assert.IsInstanceOf<NullLogger>(ApplicationContext.Logger); | 88 Assert.IsInstanceOf<NullLogger>(ApplicationContext.Logger); |
89 | 89 |
90 // Register a new logger: | 90 // Register a new logger: |
91 Assert.DoesNotThrow(() => ApplicationContext.RegisterLogger(new Mock
Logger())); | 91 Assert.DoesNotThrow(() => ApplicationContext.RegisterLogger(new Mock
Logger())); |
92 | 92 |
93 // Fail test: | 93 // Fail test: |
94 Assert.Throws<InvalidOperationException>(() => ApplicationContext.Re
gisterLogger(new MockLogger())); | 94 Assert.Throws<InvalidOperationException>(() => ApplicationContext.Re
gisterLogger(new MockLogger())); |
| 95 |
| 96 // change back to default logger |
| 97 ApplicationContext.logger = null; |
95 } | 98 } |
96 } | 99 } |
97 } | 100 } |
LEFT | RIGHT |