Ejemplo n.º 1
0
        public void UpdateBookError()
        {
            BookRow bookRow = new BookRow();
            Book    book    = new Book();

            book.author = new Author();
            bookContainer.UpdateBook(book);
            Assert.AreNotEqual(bookRow, bookContainerStub.bookRow);
        }
Ejemplo n.º 2
0
        public void UpdateBookFailed()
        {
            bookContainerStub.Testvalue = false;
            BookRow bookRow = new BookRow();
            Book    book    = new Book();

            book.author = new Author();
            bookContainer.UpdateBook(book);
            Assert.AreNotEqual(bookRow, bookContainerStub.bookRow);
        }
Ejemplo n.º 3
0
        public void UpdateBookSucces()
        {
            bookContainerStub.Testvalue = true;
            BookRow bookRow = new BookRow();
            Book    book    = new Book();

            book.author = new Author();
            bookContainer.UpdateBook(book);
            Assert.ReferenceEquals(bookRow, bookContainerStub.bookRow);
        }
Ejemplo n.º 4
0
        public object Add(Book book)
        {
            var bookRow = new BookRow {
                Title = book.Title, Price = book.Price
            };

            db.Books.Add(bookRow);

            db.SaveChanges();

            return(bookRow.Id);
        }
Ejemplo n.º 5
0
        public void DeleteBook(BookDTO book)
        {
            if (Testvalue == null)
            {
                throw new NullReferenceException("Invalid use of stub code. First set field ExistsReturnValue");
            }

            if (!Testvalue.Value)
            {
                bookRow = new BookRow();
            }
        }
Ejemplo n.º 6
0
    Book Retrieve(int id)
    {
        Book b = Books.Where(x => x.ID = id).FirstOrDefault();

        if (b != null)
        {
            return(b);
        }
        BookRow r = Table.Find(id);

        b       = new Book();
        b.ID    = r.Field <int>("ID");
        b.Title = r.Field <string>("Title");
        b.AvailableForCheckout = r.Field <bool>("AvailableForCheckout");
        return(b);
    }
            public BookRow AddBookRow(string BookID, string BookName, string BookWriter, string BookPublish, System.DateTime BookPublishDate, double BookPrice, string BookSort, int BookAmount, int BookRemain)
            {
                BookRow rowBookRow = ((BookRow)(this.NewRow()));

                object[] columnValuesArray = new object[] {
                    BookID,
                    BookName,
                    BookWriter,
                    BookPublish,
                    BookPublishDate,
                    BookPrice,
                    BookSort,
                    BookAmount,
                    BookRemain
                };
                rowBookRow.ItemArray = columnValuesArray;
                this.Rows.Add(rowBookRow);
                return(rowBookRow);
            }
 public BookRowChangeEvent(BookRow row, global::System.Data.DataRowAction action)
 {
     this.eventRow    = row;
     this.eventAction = action;
 }
 public void RemoveBookRow(BookRow row)
 {
     this.Rows.Remove(row);
 }
 public void AddBookRow(BookRow row)
 {
     this.Rows.Add(row);
 }
Ejemplo n.º 11
0
 public ReferenceItem(BookRow book, ChapterRow chapter, VerseRow verse, WordRow word)
     : this(book, chapter, verse)
 {
     Word = word;
 }
Ejemplo n.º 12
0
 public ReferenceItem(BookRow book, ChapterRow chapter, VerseRow verse)
 {
     Book    = book;
     Chapter = chapter;
     Verse   = verse;
 }