public void Schema_qualified_sequence_name_is_obtained_from_named_model_default_sequence()
        {
            var property = CreateConventionModelBuilder()
                           .ForOracleUseSequenceHiLo("DaneelOlivaw", "R")
                           .Entity <Robot>()
                           .Property(e => e.Id)
                           .Metadata;

            var cache = new OracleValueGeneratorCache(new ValueGeneratorCacheDependencies());

            Assert.Equal("DaneelOlivaw", cache.GetOrAddSequenceState(property).Sequence.Name);
            Assert.Equal("R", cache.GetOrAddSequenceState(property).Sequence.Schema);
        }
        public void Block_size_is_obtained_from_model_default_sequence()
        {
            var property = CreateConventionModelBuilder()
                           .ForOracleUseSequenceHiLo()
                           .Entity <Robot>()
                           .Property(e => e.Id)
                           .Metadata;

            var cache = new OracleValueGeneratorCache(new ValueGeneratorCacheDependencies());

            Assert.Equal(10, cache.GetOrAddSequenceState(property).Sequence.IncrementBy);
        }
        public void Sequence_name_is_obtained_from_default_sequence()
        {
            var property = CreateConventionModelBuilder()
                           .Entity <Robot>()
                           .Property(e => e.Id)
                           .ForOracleUseSequenceHiLo()
                           .Metadata;

            var cache = new OracleValueGeneratorCache(new ValueGeneratorCacheDependencies());

            Assert.Equal("EntityFrameworkHiLoSequence", cache.GetOrAddSequenceState(property).Sequence.Name);
        }
        public void Sequence_name_is_obtained_from_specified_sequence()
        {
            var property = CreateConventionModelBuilder()
                           .HasSequence("DaneelOlivaw", b => b.IncrementsBy(11))
                           .Entity <Robot>()
                           .Property(e => e.Id)
                           .ForOracleUseSequenceHiLo("DaneelOlivaw")
                           .Metadata;

            var cache = new OracleValueGeneratorCache(new ValueGeneratorCacheDependencies());

            Assert.Equal("DaneelOlivaw", cache.GetOrAddSequenceState(property).Sequence.Name);
        }
        public void Non_positive_block_sizes_are_not_allowed()
        {
            var property = CreateConventionModelBuilder()
                           .HasSequence("DaneelOlivaw", b => b.IncrementsBy(-1))
                           .Entity <Robot>()
                           .Property(e => e.Id)
                           .ForOracleUseSequenceHiLo("DaneelOlivaw")
                           .Metadata;

            var cache = new OracleValueGeneratorCache(new ValueGeneratorCacheDependencies());

            Assert.StartsWith(
                CoreStrings.HiLoBadBlockSize,
                Assert.Throws <ArgumentOutOfRangeException>(() => cache.GetOrAddSequenceState(property).Sequence.IncrementBy).Message);
        }