Skip to content

Releases: patterns-group/code-patterns

code-patterns 3.5.0-beta

12 Oct 13:11

Choose a tag to compare

Pre-release
  • Removed Patterns.Testing.Runtime.TestDateTimeInfo → mocks are easier to work with than this type
  • New components in Patterns.Reflection:
    • PropertyValue → holds metadata and runtime value of a property
    • IEnumerable<PropertyValue> object.GetPropertyValues() (extension)

code-patterns 3.4.0-beta

12 Oct 13:09

Choose a tag to compare

Pre-release
  • New logging components in Patterns.Logging (new dependency: Castle.Core):
    • LoggingInterceptor → implements IInterceptor by calling the appropriate ILog methods throughout interception (issue 12)
    • string Exception.ToFullString() (extension) → concatenates exception messages, stack traces and inner exceptions (recursive)
  • New Autofac support for Patterns.Logging in Patterns.Autofac.Modules:
    • LoggingModule → registers LoggingInterceptor, as well as attaching to all registrations in order to provide appropriately type-bound instances of ILog on-demand
  • New Autofac container type for increased accessibility: Patterns.Autofac.AccessibleContainer
  • New Moq / IoC components in Patterns.Testing.Moq:
    • IMoqContainer (depends on Microsoft.Practices.ServiceLocation and Moq) → exposes IServiceLocator; provides full IoC container support; provides Mock{TObject} creation support
    • MoqRegistrationSource → implements Autofac's IRegistrationSource by creating Mocks of services when registrations are missing
    • MoqContainer → implements IMoqContainer by using Autofac with MoqRegistrationSource

code-patterns 3.3.1-beta

12 Oct 13:06

Choose a tag to compare

Pre-release
  • New Autofac-based components (new dependencies Autofac and Autofac.CommonServiceLocator.Indy):
    • Patterns.Autofac.Modules.CoreModule → registers all non-specialized interface-based components in Patterns
    • Patterns.Autofac.Modules.ConfigurationModule → registers all components needed to support IConfigurationSource injection (issue 3)
    • Patterns.Autofac.Sources.ResolveAnythingSource → resolve-anything-creatable implementation of Autofac's IRegistrationSource
  • New extensions in Patterns.Collections:
    • void ICollection{TItem}.AddRange(IEnumerable{TItem} newItems)
    • void IEnumerable{TItem}.Each(Action{TItem} action[, bool parallel = false])
  • New configuration abstraction types in Patterns.Configuration:
    • IConfiguration / ConfigurationWrapper
    • IConfigurationManager / ConfigurationManagerWrapper
    • IConfigurationSource / ConfigurationSource
  • New exception-handling delegate runners as well as a default error-handling strategy in Patterns.ExceptionHandling:
    • TValue Try.Get(Func{TValue} valueAccessor[, Func{Exception, ExceptionState} errorHandler = null])
    • void Try.Do(Action action[, Func{Exception, ExceptionState} errorHandler = null])
    • Func{Exception, ExceptionState} Try.HandleErrors.DefaultStrategy (new dependency: Common.Logging) → uses self-bound ILog instance to log exception; marks exception as "handled"
  • New DateTime components for testability in Patterns.Runtime:
    • Patterns.Runtime.IDateTimeInfoGetNow() method returns DateTime
    • Patterns.Runtime.DefaultDateTimeInfo → proxies DateTime.Now
    • Patterns.Testing.Runtime.TestDateTimeInfo → accepts a specific DateTime value and always uses that
    • DateTime DateTime.AccurateToOneSecond() (extension)
  • New ease-of-use type for regular expressions: Patterns.Text.RegularExpressions.CompiledRegex