public void GivenArchive_WhenArchiveExistBook_ShouldReturnBookListWithArchivedBook()
        {
            // Arrange
            Book book = new Book {
                Id = 1, Name = "The Lord of the Rings"
            };

            var bookFileStorage = new BookFileStorage(_settings);

            // Act
            bookFileStorage.Archive(book);
            var result = bookFileStorage.GetAll();

            // Assert
            result.Should().BeEquivalentTo(new List <Book>
            {
                new Book {
                    Id = 1, Name = "The Lord of the Rings", IsArchive = true
                },
                new Book {
                    Id = 2, Name = "Le Petit Prince", IsArchive = false
                },
                new Book {
                    Id = 3, Name = "Harry Potter and the Philosopher's Stone", IsArchive = false
                },
                new Book {
                    Id = 4, Name = "The Hobbit", IsArchive = false
                }
            });
        }
        public void GivenArchive_WhenArchiveBookIsNull_ShouldReturnException()
        {
            // Arrange
            var bookFileStorage = new BookFileStorage(_settings);

            //Act
            TestDelegate testAction = () => bookFileStorage.Archive(null);

            //Assert
            var ex = Assert.Throws <InvalidOperationException>(testAction);

            Assert.That(ex.Message, Is.EqualTo("Can not archive null object!"));
        }
        public void GivenArchive_WhenArchiveNonExistBook_ShouldReturnException()
        {
            // Arrange
            Book book = new Book {
                Id = 5, Name = "Herbert Schildt C#"
            };

            var bookFileStorage = new BookFileStorage(_settings);

            //Act
            TestDelegate testAction = () => bookFileStorage.Archive(book);

            //Assert
            var ex = Assert.Throws <InvalidOperationException>(testAction);

            Assert.That(ex.Message, Is.EqualTo("There is not this item in the Item Storage!"));
        }