コード例 #1
0
 public void GetCustomizationFromNullParameterThrows()
 {
     // Fixture setup
     var sut = new FavorListsAttribute();
     // Exercise system and verify outcome
     Assert.Throws<ArgumentNullException>(() =>
         sut.GetCustomization(null));
     // Teardown
 }
コード例 #2
0
 public void GetCustomizationReturnsCorrectResult()
 {
     // Fixture setup
     var sut = new FavorListsAttribute();
     var parameter = typeof(TypeWithOverloadedMembers).GetMethod("DoSomething", new[] { typeof(object) }).GetParameters().Single();
     // Exercise system
     var result = sut.GetCustomization(parameter);
     // Verify outcome
     var invoker = Assert.IsAssignableFrom<ConstructorCustomization>(result);
     Assert.Equal(parameter.ParameterType, invoker.TargetType);
     Assert.IsAssignableFrom<ListFavoringConstructorQuery>(invoker.Query);
     // Teardown
 }