public CheckForErrors ( PropertyData, propertyData, bool isBeforeAfter ) : string | ||
propertyData | PropertyData, | |
isBeforeAfter | bool | |
Результат | string |
public void WhenHttpResponseContainsBadUserErrorItIsDetectedAndAInvalidApiRequestIsThrown() { var response = new HttpResponseMessage(HttpStatusCode.BadRequest) { Content = new StringContent(BadUsernameOrPasswordResponseMessage) }; ErrorChecker.CheckForErrors(response); }
public void NonAbstract() { var checker = new ErrorChecker(null, null); var propertyDefinition = DefinitionFinder.FindType<BaseClass>().Properties.First(x => x.Name == "NonAbstractProperty"); var message = checker.CheckForErrors(new PropertyData { PropertyDefinition = propertyDefinition, NotificationAddedDirectly = false }, false); Assert.IsNull(message); }
public void IsAbstract() { var checker = new ErrorChecker(null, null); var propertyDefinition = DefinitionFinder.FindType<IndexerClass>().Properties.First(); var message = checker.CheckForErrors(new PropertyData { PropertyDefinition = propertyDefinition, NotificationAddedDirectly = true }, false); Assert.IsNotNull(message); }
public void IsAbstract() { var checker = new ErrorChecker(null, null); var propertyDefinition = DefinitionFinder.FindType <IndexerClass>().Properties.First(); var message = checker.CheckForErrors(new PropertyData { PropertyDefinition = propertyDefinition, NotificationAddedDirectly = true }, false); Assert.IsNotNull(message); }
public void WithGet() { var checker = new ErrorChecker(null, null); var propertyDefinition = DefinitionFinder.FindProperty<BeforeAfterWithNoGetErrorCheckerTest>("PropertyWithGet"); var message = checker.CheckForErrors(new PropertyData { PropertyDefinition = propertyDefinition, NotificationAddedDirectly = true, }, true); Assert.IsNull(message); }
public void NonAbstract() { var checker = new ErrorChecker(null, null); var propertyDefinition = DefinitionFinder.FindType <BaseClass>().Properties.First(x => x.Name == "NonAbstractProperty"); var message = checker.CheckForErrors(new PropertyData { PropertyDefinition = propertyDefinition, NotificationAddedDirectly = false }, false); Assert.IsNull(message); }
public void WithGet() { var checker = new ErrorChecker(null, null); var propertyDefinition = DefinitionFinder.FindProperty <BeforeAfterWithNoGetErrorCheckerTest>("PropertyWithGet"); var message = checker.CheckForErrors(new PropertyData { PropertyDefinition = propertyDefinition, NotificationAddedDirectly = true, }, true); Assert.IsNull(message); }
public void WithBackingField() { var checker = new ErrorChecker(null, null); var propertyDefinition = DefinitionFinder.FindProperty(() => WithBackingFieldProperty); var message = checker.CheckForErrors(new PropertyData { PropertyDefinition = propertyDefinition, NotificationAddedDirectly = true, CheckForEquality = true, BackingFieldReference = propertyDefinition.DeclaringType.Fields[0], }, false); Assert.IsNull(message); }
public void WithBackingField() { var checker = new ErrorChecker(null, null); var propertyDefinition = DefinitionFinder.FindProperty(() => WithBackingFieldProperty); var message = checker.CheckForErrors(new PropertyData { PropertyDefinition = propertyDefinition, NotificationAddedDirectly = true, CheckForEquality = true, BackingFieldReference = propertyDefinition.DeclaringType.Fields[0], }, false); Assert.IsNull(message); }
public void WithoutBackingField() { var checker = new ErrorChecker(null, null); var propertyDefinition = DefinitionFinder.FindProperty <CheckForEqualityWithNoBackingFieldSetErrorCheckerTest>("WithoutBackingFieldProperty"); var message = checker.CheckForErrors(new PropertyData { PropertyDefinition = propertyDefinition, NotificationAddedDirectly = true, CheckForEquality = true, BackingFieldReference = null, }, false); Assert.IsNotNull(message); }
public void WithoutBackingField() { var checker = new ErrorChecker(null, null); var propertyDefinition = DefinitionFinder.FindProperty<CheckForEqualityWithNoBackingFieldSetErrorCheckerTest>("WithoutBackingFieldProperty"); var message = checker.CheckForErrors(new PropertyData { PropertyDefinition = propertyDefinition, NotificationAddedDirectly = true, CheckForEquality = true, BackingFieldReference = null, }, false); Assert.IsNotNull(message); }