public void Should_not_break_expression_chain_with_missed_expression() { ICommitMappingExpression commitExp = null; ICodeFileMappingExpression fileExp = null; commitMapper .Map(Arg.Any <IRepositoryMappingExpression>()) .Returns(x => { commitExp = Substitute.For <ICommitMappingExpression>(); return(new ICommitMappingExpression[] { commitExp }); }); bugFixMapper .Map(Arg.Any <ICommitMappingExpression>()) .Returns(x => { return(new IBugFixMappingExpression[] {}); }); fileMapper .Map(Arg.Any <ICommitMappingExpression>()) .Returns(x => { fileExp = Substitute.For <ICodeFileMappingExpression>(); return(new ICodeFileMappingExpression[] { fileExp }); }); mapper.RegisterMapper(commitMapper); mapper.RegisterMapper(bugFixMapper); mapper.RegisterMapper(fileMapper); mapper.MapRevision("1"); fileMapper.Received(1) .Map(commitExp); }
public static ProjectFileMappingExpression File(this ICommitMappingExpression exp, string filePath) { return(new ProjectFileMappingExpression( exp, exp.Queryable <ProjectFile>().Single(x => x.Path == filePath && x.DeletedInCommitID == null ) )); }
public static TagMappingExpression HasTags( this ICommitMappingExpression exp, params string[] titles) { TagMappingExpression newExp = null; foreach (var title in titles) { newExp = new TagMappingExpression(newExp ?? exp, title); } return(newExp); }
public void Should_organize_expressions_into_chain() { ICommitMappingExpression commitExp = null; IBugFixMappingExpression bugfixExp = null; ICodeFileMappingExpression fileExp = null; commitMapper .Map(Arg.Any <IRepositoryMappingExpression>()) .Returns(x => { commitExp = Substitute.For <ICommitMappingExpression>(); return(new ICommitMappingExpression[] { commitExp }); }); bugFixMapper .Map(Arg.Any <ICommitMappingExpression>()) .Returns(x => { bugfixExp = Substitute.For <IBugFixMappingExpression>(); return(new IBugFixMappingExpression[] { bugfixExp }); }); fileMapper .Map(Arg.Any <ICommitMappingExpression>()) .Returns(x => { fileExp = Substitute.For <ICodeFileMappingExpression>(); return(new ICodeFileMappingExpression[] { fileExp }); }); mapper.RegisterMapper(commitMapper); mapper.RegisterMapper(bugFixMapper); mapper.RegisterMapper(fileMapper); mapper.MapRevision("1"); commitMapper.Received(1) .Map(Arg.Any <IRepositoryMappingExpression>()); bugFixMapper.Received(1) .Map(commitExp); fileMapper.Received(1) .Map(bugfixExp); fileMapper.Received(1) .Map(Arg.Any <ICommitMappingExpression>()); }
/// <summary> /// Create a new sub-branch based on parent branch mask and offset. /// </summary> public static BranchMappingExpression OnSubBranch( this ICommitMappingExpression exp, BranchMask parentMask) { return(new BranchMappingExpression(exp, parentMask, true)); }
/// <summary> /// Create a new branch or use the existent one with specified mask and offset. /// </summary> public static BranchMappingExpression OnBranch( this ICommitMappingExpression exp, BranchMask mask) { return(new BranchMappingExpression(exp, mask, false)); }
/// <summary> /// Create a new branch from scratch without any parent branch. /// </summary> public static BranchMappingExpression OnFreshBranch( this ICommitMappingExpression exp) { return(new BranchMappingExpression(exp)); }
public static BugFixMappingExpression IsBugFix(this ICommitMappingExpression exp) { return(new BugFixMappingExpression(exp)); }
public static ReleaseMappingExpression IsRelease(this ICommitMappingExpression exp, string tag) { return(new ReleaseMappingExpression(exp, tag)); }
public static AuthorMappingExpression AuthorIs( this ICommitMappingExpression exp, string name) { return(new AuthorMappingExpression(exp, name)); }
public static CommitAttributeMappingExpression IsMerge( this ICommitMappingExpression exp) { return(new CommitAttributeMappingExpression( exp, CommitAttribute.MERGE, null)); }
public static CommitAttributeMappingExpression IsSplit( this ICommitMappingExpression exp) { return(new CommitAttributeMappingExpression( exp, CommitAttribute.SPLIT, null)); }
public static ProjectFileMappingExpression AddFile(this ICommitMappingExpression exp, string filePath) { return(new ProjectFileMappingExpression(exp, filePath)); }
public static TagMappingExpression HasTag( this ICommitMappingExpression exp, string title) { return(new TagMappingExpression(exp, title)); }
public static CodeFileMappingExpression File(this ICommitMappingExpression exp, string filePath) { return(new CodeFileMappingExpression(exp, filePath)); }