public void GetEditableRoot_WhenThrowsException_CallsLogger() { var processName = Guid.NewGuid().ToString(); var dynamicTypeManager = new DynamicTypeManager(); var loggerMock = Mock.Create<ILogger>(); dynamicTypeManager.Logger = loggerMock; dynamicTypeManager.GetEditableRoot<IEditableRoot>(processName, 1); Mock.Assert(() => loggerMock.Log(LogSeverity.Error, Arg.IsAny<string>(), Arg.IsAny<string>()), Occurs.AtLeastOnce()); }