public void Update_WhenDeckFound_Updates() { var deckHash = "deckHash"; var hashidsMock = new Mock <IHashids>(); hashidsMock.Setup(x => x.Encode(It.IsAny <int>())).Returns(deckHash); var deckRepository = new DeckRepository(DbContextFactory.Create(), hashidsMock.Object); deckRepository.Insert(new Deck()); var deck = deckRepository.GetDeck(deckHash); deck.Remaining = 21; deckRepository.Update(deck); Assert.That(deckRepository.GetDeck(deckHash).Remaining == 21); }