예제 #1
0
 public void IsNotNull_should_not_throw_exception_when_passing_non_null_value()
 {
     Assert.DoesNotThrow(() => Invariant.IsNotNull(new object(), "x"));
 }
예제 #2
0
        public SmtpClientWrapper(SmtpClient realClient)
        {
            Invariant.IsNotNull(realClient, "realClient");

            this.realClient = realClient;
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RegisterModelMetadata"/> class.
        /// </summary>
        /// <param name="container">The container.</param>
        public RegisterDependencies(ContainerAdapter container)
        {
            Invariant.IsNotNull(container, "container");

            Container = container;
        }
예제 #4
0
 public void IsNotNull_should_throw_exception_when_passing_null_value()
 {
     Assert.Throws <ArgumentNullException>(() => Invariant.IsNotNull(null, "x"));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="T:MvcExtensions.USO.RegisterAreaControllerFactory" /> class.
 /// </summary>
 /// <param name="container">The container.</param>
 public RegisterAreaControllerFactory(ContainerAdapter container)
 {
     Invariant.IsNotNull(container, "container");
     this.Container = container;
 }
예제 #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ConfigurableTypeMappingBase{TType1,TType2}"/> class.
        /// </summary>
        /// <param name="registry">The registry.</param>
        protected ConfigurableTypeMappingBase(TypeMappingRegistry <TType1, TType2> registry)
        {
            Invariant.IsNotNull(registry, "registry");

            Registry = registry;
        }
예제 #7
0
        public static string UrlDecode(this string source)
        {
            Invariant.IsNotNull(source, nameof(source));

            return(HttpUtility.UrlDecode(source));
        }
예제 #8
0
        public static string AttributeEncode(this string source)
        {
            Invariant.IsNotNull(source, nameof(source));

            return(HttpUtility.HtmlAttributeEncode(source));
        }
예제 #9
0
        public EmailTemplateModelWrapper(IDictionary <string, object> propertyMap)
        {
            Invariant.IsNotNull(propertyMap, "propertyMap");

            this.propertyMap = propertyMap;
        }
예제 #10
0
 public static IStreamable <Empty, TPayload> ToCleanStreamable <TPayload>(this StreamEvent <TPayload>[] input)
 {
     Invariant.IsNotNull(input, "input");
     return(input.OrderBy(v => v.SyncTime).ToArray().ToStreamable());
 }
예제 #11
0
 public static StreamEvent <TPayload>[] ToStreamEventArray <TPayload>(this IStreamable <Empty, TPayload> input)
 {
     Invariant.IsNotNull(input, "input");
     return(input.ToStreamEventObservable().ToEnumerable().ToArray());
 }