Ejemplo n.º 1
0
        public void ThrowAnExceptionWhen_SignatureIsNull()
        {
            var repository = NSubstitute.Substitute.For <IRepository>();
            var provider   = new CommitProvider(repository);

            Assert.Throws <ArgumentNullException>(() => provider.Commit("message", null));
        }
Ejemplo n.º 2
0
        public void ThrowAnExceptionWhen_MessageIsNullOrEmpty(string message)
        {
            var repository = NSubstitute.Substitute.For <IRepository>();
            var provider   = new CommitProvider(repository);

            Assert.Throws <ArgumentNullException>(() => provider.Commit(message, Any <Signature>()));
        }
Ejemplo n.º 3
0
        public void CallCommitMethod()
        {
            var repository = NSubstitute.Substitute.For <IRepository>();
            var provider   = new CommitProvider(repository);
            var signature  = new Signature("sd", "sd", DateTimeOffset.Now);

            provider.Commit("message", signature);
            repository.Received().Commit("message", signature, signature);
        }