public void AddTweet_GivenTweet_AddsTweetToDocumentStore() { var test = new TwitterDocumentStore(_fakeDocumentStoreFactory.Object); Tweet tweet = New.Tweet; test.AddTweet(tweet); _fakeDocumentSession.Verify(x => x.Store(tweet)); _fakeDocumentSession.Verify(x => x.Dispose()); }
public void Add_GivenTweet_AddsTweetToDocumentStore() { var test = new TwitterDocumentStore(_documentStoreFactory); var tweet = new Tweet(); test.Add(tweet); _documentSession.Received().Store(tweet); _documentSession.Received().Dispose(); }
public void GetTweet_GivenTweetThatIsInTheStore_ReturnsTheTweet() { var tweet = new Tweet(); string id = "The tweet id"; var test = new TwitterDocumentStore(_documentStoreFactory); _documentSession.Load<Tweet>(id).Returns(tweet); test.GetTweet(id).Should().Be.SameAs(tweet); }