private static DocumentCategory Create(int id) { return(new DocumentCategory() { Id = id, Name = MockGenerator.GetString(50), Description = MockGenerator.GetString(255) }); }
public void Should_DocumentCategoryValidator_Description_MaximumLength() { documentCategory.Description = MockGenerator.GetString(255); results = validator.Validate(documentCategory); Assert.IsTrue(results.IsValid); documentCategory.Description = MockGenerator.GetString(256); results = validator.Validate(documentCategory); Assert.IsFalse(results.IsValid); }
public void Should_DocumentCategoryValidator_Name_MaximumLength() { documentCategory.Name = MockGenerator.GetString(50); results = validator.Validate(documentCategory); Assert.IsTrue(results.IsValid); documentCategory.Name = MockGenerator.GetString(51); results = validator.Validate(documentCategory); Assert.IsFalse(results.IsValid); }
public void Should_GetString_Default_MaxSize() { var actual = MockGenerator.GetString(); Assert.AreEqual(1, actual.Length); }
public void Should_GetString_Set_Zero_MaxSize() { var actual = MockGenerator.GetString(0); Assert.AreEqual(0, actual.Length); }