public void GetAll_ThreeItemsInCollection_ShouldReturnAllThree()
        {
            _artistRepository.Add(_testArtistOne);
            _artistRepository.Add(_testArtistTwo);
            _artistRepository.Add(_testArtistThree);

            var resultFromDatabase = _artistRepository.GetAll();

            Assert.AreEqual(3, resultFromDatabase.Count);

            ArtistAssertor.New()
            .Expected(_testArtistOne)
            .Actual(resultFromDatabase.Find(a => a.Id == _testArtistOne.Id))
            .DoAssert();

            ArtistAssertor.New()
            .Expected(_testArtistTwo)
            .Actual(resultFromDatabase.Find(a => a.Id == _testArtistTwo.Id))
            .DoAssert();

            ArtistAssertor.New()
            .Expected(_testArtistThree)
            .Actual(resultFromDatabase.Find(a => a.Id == _testArtistThree.Id))
            .DoAssert();
        }
        public void UpdateById_InvalidObjectId_ShouldReturnFalseAndNotUpdate()
        {
            // Setup
            _artistRepository.Add(_testArtistOne);

            var updatedDetails = new Artist
            {
                Name = "Ringo Star",
                LastSearchedForDate = new DateTime(2019, 08, 10)
            };

            // Perform
            var invalidId = "5c72a6f52f44614ba8c56071";
            var result    = _artistRepository.UpdateById(invalidId, _testArtistOne);

            // Verify
            Assert.IsFalse(result);

            var recordFromDatabase = _mongoDatabaseUtilities.FindRecordById(_testArtistOne.Id);

            ArtistAssertor.New()
            .Expected(_testArtistOne)
            .Actual(recordFromDatabase[0])
            .DoAssert();
        }
        public void Add_SingleValidArtist_ShouldBeInserted()
        {
            _artistRepository.Add(_testArtistOne);

            var retrievedArtist = _mongoDatabaseUtilities.FindRecordById(_testArtistOne.Id);

            ArtistAssertor.New()
            .Expected(_testArtistOne)
            .Actual(retrievedArtist[0])
            .DoAssert();
        }
        public void GetbyId_ValidObjectId_ShouldReturnSingleArtist()
        {
            _artistRepository.Add(_testArtistOne);
            // This has same details, but different Id to the above
            _artistRepository.Add(TestArtistOne());

            var result = _artistRepository.GetById(_testArtistOne.Id);

            ArtistAssertor.New()
            .Expected(_testArtistOne)
            .Actual(result)
            .DoAssert();
        }
        public void UpdateById_ValidObjectId_ShouldUpdateAndReturnTrue()
        {
            _artistRepository.Add(_testArtistOne);
            _artistRepository.Add(_testArtistTwo);

            _testArtistOne.Name = "Ringo Star";
            _testArtistOne.LastSearchedForDate = new DateTime(2019, 08, 10);

            var result = _artistRepository.UpdateById(_testArtistOne.Id, _testArtistOne);

            Assert.IsTrue(result);

            var recordFromDatabase = _mongoDatabaseUtilities.FindRecordById(_testArtistOne.Id);

            ArtistAssertor.New()
            .Expected(_testArtistOne)
            .Actual(recordFromDatabase[0])
            .DoAssert();
        }