Exemple #1
0
        public async System.Threading.Tasks.Task DontShoulAddAllBeadsAsync()
        {
            BeadsController controller = new BeadsController(_context);
            Bead            bead       = new Bead {
                ColorId = 1, BeadsTypeId = 1, Num = "1111", Image = "dsfsd"
            };
            await controller.PostBead(bead);

            await controller.PostBead(bead);

            var query  = new GetBeadsQuery(_context);
            var result = query.Execute();

            Assert.Equal(1, result.Count);
        }
Exemple #2
0
        public async System.Threading.Tasks.Task DontShoulPutAllBeadsAsync()
        {
            BeadsController controller = new BeadsController(_context);
            Bead            bead       = new Bead {
                ColorId = 1, BeadsTypeId = 1, Num = "1111", Image = "dsfsd"
            };
            Bead bead1 = new Bead {
                ColorId = 1, BeadsTypeId = 1, Num = "111", Image = "dsfs"
            };
            await controller.PostBead(bead);

            await controller.PostBead(bead1);

            Bead cbead = new Bead {
                Id = 2, ColorId = 1, BeadsTypeId = 1, Num = "1111", Image = "dsfs"
            };
            await controller.PutBead(2, cbead);

            var query  = new GetBeadsQuery(_context);
            var result = query.Execute();

            Assert.Equal("111", result[1].Num);
        }