public void AddScript(ScriptReference scriptReference)
 {
     if (Scripts.All(x => x.ScriptPath != scriptReference.ScriptPath))
     {
         _scripts.Add(scriptReference);
     }
 }
Exemple #2
0
 public bool IsValid()
 {
     return(!string.IsNullOrEmpty(Name) &&
            !string.IsNullOrEmpty(Title) &&
            !string.IsNullOrEmpty(Description) &&
            Uri.IsWellFormedUriString(Url.ToString(), UriKind.RelativeOrAbsolute) &&
            Uri.IsWellFormedUriString(ParentStoryUrl.ToString(), UriKind.RelativeOrAbsolute) &&
            KeyIdentifiers != null &&
            KeyIdentifiers.Any() ? KeyIdentifiers.All(s => s.IsValid()) : true &&
            TestCases != null &&
            TestCases.Any() ? TestCases.All(s => s.IsValid()) : true &&
            Checkups != null &&
            Checkups.Any() ? Checkups.All(s => s.IsValid()) : true &&
            Attachments != null &&
            Attachments.Any() ? Attachments.All(s => Uri.IsWellFormedUriString(s.Value, UriKind.RelativeOrAbsolute)) : true &&
            Queries != null &&
            Queries.Any() ? Queries.All(s => Uri.IsWellFormedUriString(s.Value, UriKind.RelativeOrAbsolute)) : true &&
            Scripts != null &&
            Scripts.Any() ? Scripts.All(s => Uri.IsWellFormedUriString(s.Value, UriKind.RelativeOrAbsolute)) : true &&
            SubTasks.Any() ? SubTasks.All(s => s.IsValid()) : true);
 }