예제 #1
0
        public void ItShouldAdd()
        {
            //arrange

            //act
            _sut.Add(new Review {
                Rating = 500, Comment = "good"
            });

            context.SaveChanges();

            //assert
            Assert.AreEqual(1, context.Reviews.Where(x => x.Rating == 500).ToList().Count());
        }
        public void ItShouldAdd()
        {
            //arrange

            //act
            _sut.Add(new Client {
                Name = "Pop", Surname = "Andrew", Phone = 0744441111, Email = "*****@*****.**"
            });

            context.SaveChanges();

            //assert
            Assert.AreEqual(1, context.Clients.Where(x => x.Name == "Pop").ToList().Count());
        }
        public void ItShouldAdd()
        {
            //arrange

            //act
            _sut.Add(new Author {
                Name = "Pop"
            });

            context.SaveChanges();

            //assert
            Assert.AreEqual(1, context.Authors.Where(x => x.Name == "Pop").ToList().Count());
        }
        public void ItShouldAdd()
        {
            //arrange

            //act
            _sut.Add(new Book {
                Title = "1984"
            });

            context.SaveChanges();

            //assert
            Assert.AreEqual(1, context.Books.Where(x => x.Title == "1984").ToList().Count());
        }
예제 #5
0
        public void ItShouldAdd()
        {
            //arrange

            //act
            _sut.Add(new Publisher {
                Name = "Pop", Code = "00BV"
            });

            context.SaveChanges();

            //assert
            Assert.AreEqual(1, context.Publishers.Where(x => x.Code == "00BV").ToList().Count());
        }
            public void ItShouldAdd()
            {
                //arrange

                //act
                _sut.Add(new Address {
                    City = "Iasi", Street = "Strada porumbeilor", PostalCode = "720214"
                });

                context.SaveChanges();

                //assert
                Assert.AreEqual(1, context.Addresses.Where(x => x.City == "Iasi").ToList().Count());
            }
        public void ItShouldAdd()
        {
            //arrange

            //act
            _sut.Add(new Loan {
                LoanDate = DateTime.Now, Tax = 100, DelayPenalty = 500
            });

            context.SaveChanges();

            //assert
            Assert.AreEqual(1, context.Loans.Where(x => x.Tax == 100).ToList().Count());
        }