Example #1
0
 public static ModificationMappingExpression CopiedFrom(
     this ICodeFileMappingExpression exp,
     string sourseFilePath,
     string sourceRevision)
 {
     return(new ModificationMappingExpression(exp, sourseFilePath, sourceRevision));
 }
Example #2
0
        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);
        }
Example #3
0
        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>());
        }
Example #4
0
 public static ModificationMappingExpression Modified(this ICodeFileMappingExpression exp)
 {
     return(new ModificationMappingExpression(exp, TouchedFileAction.MODIFIED));
 }
Example #5
0
 public static IModificationMappingExpression Removed(this ICodeFileMappingExpression exp)
 {
     return(new ModificationMappingExpression(exp, TouchedFileAction.REMOVED));
 }