예제 #1
0
        public void Log_DoesNotSaveLogs()
        {
            entry.State = EntityState.Added;
            DbContext context = Substitute.For <DbContext>();

            logger = Substitute.ForPartsOf <AuditLogger>(context);
            logger.When(sub => sub.Log(Arg.Any <LoggableEntity>())).DoNotCallBase();

            logger.Log(new[] { entry });

            logger.DidNotReceive().Save();
            context.DidNotReceive().SaveChanges();
        }