public void TestCheckNeeds__ExceptionWhileLoggingException() { string[] modList = { "mod1", "mod2" }; UrlDir.UrlConfig config1 = UrlBuilder.CreateConfig(new ConfigNode("SOME_NODE"), file); UrlDir.UrlConfig config2 = UrlBuilder.CreateConfig(new ConfigNode("SOME_NODE:NEEDS[mod3]"), file); UrlDir.UrlConfig config3 = UrlBuilder.CreateConfig(new ConfigNode("SOME_NODE"), file); Exception e1 = new Exception(); Exception e2 = new Exception(); progress.When(p => p.NeedsUnsatisfiedRoot(config2)).Throw(e1); progress.WhenForAnyArgs(p => p.Exception(null, null, null)).Throw(e2); NeedsChecker.CheckNeeds(root, modList, progress, logger); progress.ReceivedWithAnyArgs().Exception(null, null, null); progress.DidNotReceiveWithAnyArgs().Error(null, null); progress.Received().Exception("Exception while attempting to log an exception", e2); Assert.Equal(new[] { config1, config3 }, root.AllConfigs); }