Ejemplo n.º 1
0
        public void Execute_NothingToReplace_SameValues()
        {
            var list = new List <object>()
            {
                1, 3, 5
            };
            var strategy = new ReplaceByDefaultStrategy(ColumnType.Numeric, 0);

            Assert.That(strategy.Execute(list), Has.Member(1));
            Assert.That(strategy.Execute(list), Has.Member(3));
            Assert.That(strategy.Execute(list), Has.Member(5));
        }
Ejemplo n.º 2
0
        public void Execute_Null_NullReplaced()
        {
            var list = new List <object>()
            {
                1, 3, 5, null
            };
            var strategy = new ReplaceByDefaultStrategy(ColumnType.Numeric, 0);

            Assert.That(strategy.Execute(list).Count, Is.EqualTo(4));
            Assert.That(strategy.Execute(list), Has.Member(0));
            Assert.That(strategy.Execute(list), Has.Member(1));
            Assert.That(strategy.Execute(list), Has.Member(3));
            Assert.That(strategy.Execute(list), Has.Member(5));
        }
Ejemplo n.º 3
0
        public void Execute_Blank_BlankReplaced()
        {
            var list = new List <object>()
            {
                1, "(blank)", 3, 5
            };
            var strategy = new ReplaceByDefaultStrategy(ColumnType.Numeric, -1);

            Assert.That(strategy.Execute(list).Count, Is.EqualTo(4));
            Assert.That(strategy.Execute(list), Has.Member(-1));
            Assert.That(strategy.Execute(list), Has.Member(1));
            Assert.That(strategy.Execute(list), Has.Member(3));
            Assert.That(strategy.Execute(list), Has.Member(5));
        }
Ejemplo n.º 4
0
        public void Execute_NothingToReplace_NothingDropped()
        {
            var list = new List <object>()
            {
                1, 3, 5
            };
            var strategy = new ReplaceByDefaultStrategy(ColumnType.Numeric, 0);

            Assert.That(strategy.Execute(list).Count, Is.EqualTo(3));
        }