Exemple #1
0
        public void Should_use_registered_mapper()
        {
            commitMapper
            .Map(Arg.Any <RepositoryMappingExpression>())
            .Returns(Enumerable.Empty <CommitMappingExpression>());

            mapper.RegisterMapper(commitMapper);
            mapper.MapRevision("1");

            commitMapper.Received(1)
            .Map(Arg.Is <RepositoryMappingExpression>(e => e != null));
        }
Exemple #2
0
        public void Should_add_commit()
        {
            var log = new TestLog("1", null, null, DateTime.Today, null);

            vcsData.Log(Arg.Is <string>("1")).Returns(log);

            mappingDSL.Revision = "1";
            mapper.Map(mappingDSL);
            SubmitChanges();

            Assert.Equal(1, Get <Commit>().Count());
            var commit = Get <Commit>().Single();

            Assert.Equal(log.Revision, commit.Revision);
            Assert.Equal(log.Date, commit.Date);
            Assert.Equal(log.Message, commit.Message);
        }