Ejemplo n.º 1
0
        public void testFindPK()
        {
            IGlassRecipePowderMapper mapper = new GlassRecipePowderMapper();

            mapper.deleteAll();
            mapper.save(new GlassRecipeVo("a", "b", "c", 15.0));
            Optional <GlassRecipeVo> vo1 = mapper.findByCustomerAndGlassAndPowder("a", "b", "c");

            Assert.AreEqual(15.0, vo1.get().Weight);
        }
Ejemplo n.º 2
0
        public void testSaveAll()
        {
            IGlassRecipePowderMapper mapper = new GlassRecipePowderMapper();

            mapper.deleteAll();

            List <GlassRecipeVo> list = new List <GlassRecipeVo>();

            list.Add(new GlassRecipeVo("a", "b", "c", 11.0));
            list.Add(new GlassRecipeVo("av", "b", "c", 12));
            list.Add(new GlassRecipeVo("ad", "b", "c", 13));

            mapper.saveAll(list);
            Assert.AreEqual(3, list.Count);
        }
Ejemplo n.º 3
0
        public void testFindAll()
        {
            IGlassRecipePowderMapper mapper = new GlassRecipePowderMapper();

            mapper.deleteAll();

            mapper.save(new GlassRecipeVo("a", "b", "c", 15.0));
            mapper.save(new GlassRecipeVo("a", "bd", "c", 15.0));
            mapper.save(new GlassRecipeVo("a", "b", "cc", 15.0));

            Assert.AreEqual(3, mapper.findAll().Count);

            mapper.deleteAll();
            mapper.findAll();
        }
Ejemplo n.º 4
0
        public void testSearch()
        {
            IGlassRecipePowderMapper mapper = new GlassRecipePowderMapper();

            mapper.deleteAll();

            mapper.save(new GlassRecipeVo("a", "b", "c", 15.0));
            mapper.save(new GlassRecipeVo("a", "bd", "c", 15.0));
            mapper.save(new GlassRecipeVo("a", "b", "cc", 15.0));

            Assert.AreEqual(3, mapper.search("b").Count);
            Assert.AreEqual(1, mapper.search("d").Count);

            mapper.deleteAll();
            Assert.AreEqual(0, mapper.search("b").Count);
        }