コード例 #1
0
 public override void SetUp()
 {
     base.SetUp();
     scmDataStub      = MockRepository.GenerateStub <IScmData>();
     mapper           = new MappingController(scmDataStub);
     commitMapperStub = MockRepository.GenerateStub <CommitMapper>(null as IScmData);
     bugFixMapperStub = MockRepository.GenerateStub <BugFixMapper>(null, null);
     fileMapperStub   = MockRepository.GenerateStub <ProjectFileMapper>(null as IScmData);
 }
コード例 #2
0
        public void Should_use_registered_mapper()
        {
            commitMapperStub = MockRepository.GenerateMock <CommitMapper>(null as IScmData);
            commitMapperStub.Expect(x => x.Map(null))
            .IgnoreArguments()
            .Constraints(Rhino.Mocks.Constraints.Is.NotNull())
            .Return(Enumerable.Empty <CommitMappingExpression>());

            mapper.RegisterMapper(commitMapperStub);

            mapper.Map(data, "1");

            commitMapperStub.VerifyAllExpectations();
        }
コード例 #3
0
        public void Should_not_keep_expressions_between_sessions()
        {
            CommitMappingExpression commitExp = mappingDSL.AddCommit("1");

            commitMapperStub = MockRepository.GenerateMock <CommitMapper>(null as IScmData);
            commitMapperStub.Expect(x => x.Map(null))
            .IgnoreArguments()
            .Return(new CommitMappingExpression[] { commitExp })
            .Repeat.Twice();
            mapper.RegisterMapper(commitMapperStub);

            mapper.Map(data, "1");
            mapper.Map(data, "1");
        }
コード例 #4
0
        public void Should_set_revision_being_mapped()
        {
            commitMapperStub = MockRepository.GenerateMock <CommitMapper>(null as IScmData);
            commitMapperStub.Expect(x => x.Map(null))
            .IgnoreArguments()
            .Constraints(Rhino.Mocks.Constraints.Is.Matching(
                             (RepositoryMappingExpression e) => e.Revision == "10"
                             ))
            .Return(Enumerable.Empty <CommitMappingExpression>());

            mapper.RegisterMapper(commitMapperStub);
            mapper.Map(data, "10");

            commitMapperStub.VerifyAllExpectations();
        }
コード例 #5
0
 public override void SetUp()
 {
     base.SetUp();
     mapper = new CommitMapper(scmData);
 }