public void CanAnnotate_should_throw_exception_if_nothing_defined() { var command = new AnnotateAsset(); ValidationAssert.Throws(() => GuardAsset.CanAnnotate(command), new ValidationError("Either file name, slug, tags or metadata must be defined.", "FileName", "Slug", "Tags", "Metadata")); }
public void CanAnnotate_should_throw_exception_if_nothing_defined() { var command = new AnnotateAsset(); ValidationAssert.Throws(() => GuardAsset.CanAnnotate(command), new ValidationError("At least one property must be defined.", "FileName", "IsProtected", "Metadata", "Slug", "Tags")); }
public void CanAnnotate_should_not_throw_exception_if_a_value_is_passed() { var command = new AnnotateAsset { AppId = appId, FileName = "new-name", Slug = "new-slug" }; GuardAsset.CanAnnotate(command); }
public void CanAnnotate_should_not_throw_exception_if_names_are_different() { var command = new AnnotateAsset { FileName = "new-name", Slug = "new-slug" }; GuardAsset.CanAnnotate(command, "asset-name", "asset-slug"); }
public void CanAnnotate_should_not_throw_exception_if_empty() { var command = new AnnotateAsset { AppId = appId }; GuardAsset.CanAnnotate(command); }
public void CanAnnotate_should_throw_exception_if_slugs_are_the_same() { var command = new AnnotateAsset { Slug = "asset-slug" }; ValidationAssert.Throws(() => GuardAsset.CanAnnotate(command, "asset-name", "asset-slug"), new ValidationError("Asset has already this slug.", "Slug")); }