public void IntField_IsRequiresTrue_ResultFalse() { //arrange IntFieldBuilder intField = new IntFieldBuilder("value_test", isRequired: true); IntFieldResponse fieldResponse = new IntFieldResponse(intField); //act ValidationResult result = fieldResponse.Validate(); //assert Assert.False(result.IsValid, "Regras do IsRequires não estão ok."); }
public void IntField_MinValue_ResultFalse(int value) { //arrange IntFieldBuilder intField = new IntFieldBuilder("value_test", minValue: 2); IntFieldResponse fieldResponse = new IntFieldResponse(intField); fieldResponse.SetValue(value); //act ValidationResult result = fieldResponse.Validate(); //assert Assert.False(result.IsValid, "Regras do MinValue não estão ok."); }
public void TextField_CreateNewField_ResultTrue(int value) { //arrange IntFieldBuilder intField = new IntFieldBuilder("value_test", 5, 10, true); IntFieldResponse fieldResponse = new IntFieldResponse(intField); fieldResponse.SetValue(value); //act ValidationResult result = fieldResponse.Validate(); //assert Assert.True(result.IsValid, "Regras do MinValue não estão ok."); }
public void IntField_Success() { //arrange IntFieldBuilder intField = new IntFieldBuilder("idade", 10, 20, false); IntFieldResponse fieldResponse = new IntFieldResponse(intField); fieldResponse.SetValue(12); //act ValidationResult result = fieldResponse.Validate(); //assert Assert.True(result.IsValid, "Regras não estão ok."); }