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); }
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(); }
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"); }
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(); }
public override void SetUp() { base.SetUp(); mapper = new CommitMapper(scmData); }