public void Add() { var conn = new MSolrConnection(); conn.post &= x => x.Args("/update", "<add><doc /></add>").Expect(1); Solr.Connection = conn; Solr.Add(new TestDocument()); conn.post.Verify(); }
public void Add() { var mocks = new MockRepository(); var conn = mocks.StrictMock <ISolrConnection>(); With.Mocks(mocks) .Expecting(() => Expect.Call(conn.Post("/update", "<add><doc /></add>")).Return("")) .Verify(() => { Solr.Connection = conn; Solr.Add(new TestDocument()); }); }