Ejemplo n.º 1
0
        public void InsertTest()
        {
            var rec = new IdValue()
            {
                Value = "The new one"
            };

            int id = _gateway.Insert(rec);

            Assert.That(id >= 3);
        }
Ejemplo n.º 2
0
        public void DeleteTest()
        {
            var recs = _gateway.Select().Where(x => x.Value.Equals("The new one"));

            if (!recs.Any())
            {
                var rec = new IdValue()
                {
                    Value = "The new one"
                };
                _gateway.Insert(rec);
            }

            recs = _gateway.Select().Where(x => x.Value.Equals("The new one")).ToList();
            foreach (var idValue in recs)
            {
                _gateway.Delete(idValue.Id);
            }

            var afterDelete = _gateway.Select().Where(x => x.Value.Equals("The new one")).ToList();

            Assert.That(recs.Any());
            Assert.That(!afterDelete.Any());
        }