Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
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");
        }
Ejemplo n.º 3
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();
        }