From bef9af4679da595d2be51eb18518741a346c75c6 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 15 Jan 2015 14:20:00 -0800 Subject: [PATCH] Fixing build break * Run ModelBinding test that uses Moq to run under ASPNET50 * Update AssociatedValidatorProviderTest to reflect API changes --- .../Binders/FormFileModelBinderTest.cs | 4 ++++ .../AssociatedValidatorProviderTest.cs | 22 +++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/test/Microsoft.AspNet.Mvc.ModelBinding.Test/Binders/FormFileModelBinderTest.cs b/test/Microsoft.AspNet.Mvc.ModelBinding.Test/Binders/FormFileModelBinderTest.cs index ecc2c23531..9d34c6365c 100644 --- a/test/Microsoft.AspNet.Mvc.ModelBinding.Test/Binders/FormFileModelBinderTest.cs +++ b/test/Microsoft.AspNet.Mvc.ModelBinding.Test/Binders/FormFileModelBinderTest.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +#if ASPNET50 + using System; using System.Collections.Generic; using System.Threading; @@ -169,3 +171,5 @@ namespace Microsoft.AspNet.Mvc.ModelBinding } } } + +#endif \ No newline at end of file diff --git a/test/Microsoft.AspNet.Mvc.ModelBinding.Test/Validation/AssociatedValidatorProviderTest.cs b/test/Microsoft.AspNet.Mvc.ModelBinding.Test/Validation/AssociatedValidatorProviderTest.cs index e96d67d176..26781cbb0f 100644 --- a/test/Microsoft.AspNet.Mvc.ModelBinding.Test/Validation/AssociatedValidatorProviderTest.cs +++ b/test/Microsoft.AspNet.Mvc.ModelBinding.Test/Validation/AssociatedValidatorProviderTest.cs @@ -19,11 +19,11 @@ namespace Microsoft.AspNet.Mvc.ModelBinding public void GetValidatorsForPropertyWithLocalAttributes() { // Arrange - IEnumerable callbackAttributes = null; + IEnumerable callbackAttributes = null; var metadata = _metadataProvider.GetMetadataForProperty(null, typeof(PropertyModel), "LocalAttributes"); var provider = new Mock { CallBase = true }; - provider.Setup(p => p.AbstractGetValidators(metadata, It.IsAny>())) - .Callback>((m, attributes) => callbackAttributes = attributes) + provider.Setup(p => p.AbstractGetValidators(metadata, It.IsAny>())) + .Callback>((m, attributes) => callbackAttributes = attributes) .Returns((IEnumerable)null) .Verifiable(); @@ -39,11 +39,11 @@ namespace Microsoft.AspNet.Mvc.ModelBinding public void GetValidatorsForPropertyWithMetadataAttributes() { // Arrange - IEnumerable callbackAttributes = null; + IEnumerable callbackAttributes = null; var metadata = _metadataProvider.GetMetadataForProperty(null, typeof(PropertyModel), "MetadataAttributes"); - Mock provider = new Mock { CallBase = true }; - provider.Setup(p => p.AbstractGetValidators(metadata, It.IsAny>())) - .Callback>((m, attributes) => callbackAttributes = attributes) + var provider = new Mock { CallBase = true }; + provider.Setup(p => p.AbstractGetValidators(metadata, It.IsAny>())) + .Callback>((m, attributes) => callbackAttributes = attributes) .Returns((IEnumerable)null) .Verifiable(); @@ -59,11 +59,11 @@ namespace Microsoft.AspNet.Mvc.ModelBinding public void GetValidatorsForPropertyWithMixedAttributes() { // Arrange - IEnumerable callbackAttributes = null; + IEnumerable callbackAttributes = null; var metadata = _metadataProvider.GetMetadataForProperty(null, typeof(PropertyModel), "MixedAttributes"); - Mock provider = new Mock { CallBase = true }; - provider.Setup(p => p.AbstractGetValidators(metadata, It.IsAny>())) - .Callback>((m, attributes) => callbackAttributes = attributes) + var provider = new Mock { CallBase = true }; + provider.Setup(p => p.AbstractGetValidators(metadata, It.IsAny>())) + .Callback>((m, attributes) => callbackAttributes = attributes) .Returns((IEnumerable)null) .Verifiable();