예제 #1
0
        public void ExecuteEvolution_Success()
        {
            //Arrange
            var          success          = false;
            const string evolutionContent = "select sysdate from dual;";

            var context = new EvolutionContextBuilder()
                          .AddGetEvolutionBehavior(new List <IEvolution>())
                          .Context;

            //Act
            var repo = new EvolutionRepo(context);

            try
            {
                repo.ExecuteEvolution(evolutionContent);
                success = true;
            }
            catch (Exception)
            {
                success = false;
            }

            //Assert
            Assert.True(success);
        }
예제 #2
0
        public void GetExecutedEvolutions()
        {
            //Arrange
            var evolutions = new List <IEvolution>()
            {
                new Data.Entity.Evolution()
                {
                    Name = "Evolution1"
                },
                new Data.Entity.Evolution()
                {
                    Name = "Evolution2"
                },
                new Data.Entity.Evolution()
                {
                    Name = "Evolution3"
                }
            };

            var context = new EvolutionContextBuilder()
                          .AddGetEvolutionBehavior(evolutions)
                          .Context;

            //Act
            var repo = new EvolutionRepo(context);
            var executedEvolutions = repo.GetExecutedEvolutionFileNames();

            //Assert
            Assert.Equal(evolutions.Count, executedEvolutions.Length);
        }