public void TestThatisEndResultIs500Characters() { testDbItem.endResult = new string('a', 500); var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(0, results.Count); }
public void TestThatDescriptionis500Characters() { testDbItem.description = new string('a', 500); var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(0, results.Count); }
public void TestThatIDIsValid() { testDbItem.ID = 1; var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(0, results.Count); }
public void TestThatRecyclableReasonIs500Characters() { testDbItem.recycleReason = new string('a', 500); var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(0, results.Count); }
public void TestThatPictureIDIsAString() { testDbItem.imageURL = "pizza"; var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(0, results.Count); //no errors }
public void TestThatDescriptionisValid() { testDbItem.description = "PRJ2Cosmo"; var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(0, results.Count); //NoError }
public void TestThatisqtyRecycledIsValid() { testDbItem.qtyRecycled = 1234567; var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(0, results.Count); //Noerror }
public void TestThatNameIsEmpty() { testDbItem.name = null; var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(1, results.Count); Assert.AreEqual("Name is required", results[0].ErrorMessage); }
public void TestThatRecyclableReasonIsValid() { testDbItem.recycleReason = "Because stone cold steve austin said so"; var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(0, results.Count); //noerror }
public void TestThatisEndResultisValid() { testDbItem.endResult = "toilet paper for babies. this ad was sponsered by huggies"; var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(0, results.Count); //Noerror }
public void TestThatisRecyclableIsTrue() { testDbItem.isRecyclable = true; var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(0, results.Count); //NoError }
public void TestThatPictureIDis90Characters() { testDbItem.imageURL = new string('a', 90); var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(0, results.Count); //error }
public void TestThatNameIs50CharsLong() { testDbItem.name = new string('a', 50); var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(0, results.Count); //no errors }
public void TestThatNameIs51CharsLong() { //ErrorMessage = "name must be 50 characters or less." testDbItem.name = new string('a', 51); var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(1, results.Count); Assert.AreEqual("name must be 50 characters or less.", results[0].ErrorMessage); }
public void TestThatDescriptionisGreaterThan500Characters() { testDbItem.description = new string('a', 501); var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(1, results.Count); Assert.AreEqual("Description must be 500 characters or less.", results[0].ErrorMessage); //error }
public void TestThatPictureIDIsEmpty() { testDbItem.imageURL = null; var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(1, results.Count); Assert.AreEqual("PictureID is required", results[0].ErrorMessage); //errors }
public void TestThatDescriptionisEmpty() { testDbItem.description = null; var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(1, results.Count); Assert.AreEqual("Description is required", results[0].ErrorMessage); //error }
public void TestThatPictureIDCanNotbeGreaterThan90Characters() { testDbItem.imageURL = new string('a', 91); var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(1, results.Count); Assert.AreEqual("PictureID must be 90 characters or less", results[0].ErrorMessage); //error }
public void TestThatRecyclableReasonIsEmpty() { testDbItem.recycleReason = null; var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(1, results.Count); Assert.AreEqual("Disposable must have a recyclable reason", results[0].ErrorMessage); //error }
public void TestThatisEndResultIsEmpty() { testDbItem.endResult = null; var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(1, results.Count); Assert.AreEqual("An end result is required", results[0].ErrorMessage); //error }
public void AllRecyclableInformationIsValidTest() { var results = HelperTestModel.Validate(testDbItem); Assert.AreEqual(0, results.Count); }