public void Ping() { var mocks = new MockRepository(); var basicServer = mocks.StrictMock<ISolrBasicOperations<TestDocument>>(); With.Mocks(mocks) .Expecting(() => Expect.Call(basicServer.Ping()).Return(new ResponseHeader())) .Verify(() => { var s = new SolrServer<TestDocument>(basicServer, null, null); s.Ping(); }); }
public void Ping() { var basicServer = new MSolrBasicOperations <TestDocument> { ping = () => new ResponseHeader { QTime = 2 }, }; var s = new SolrServer <TestDocument>(basicServer, null, null); var r = s.Ping(); Assert.Equal(2, r.QTime); }
public void Ping() { var mocks = new MockRepository(); var basicServer = mocks.StrictMock <ISolrBasicOperations <TestDocument> >(); With.Mocks(mocks) .Expecting(() => Expect.Call(basicServer.Ping()).Return(new ResponseHeader())) .Verify(() => { var s = new SolrServer <TestDocument>(basicServer, null, null); s.Ping(); }); }
public void Ping() { var mocks = new MockRepository(); var basicServer = mocks.CreateMock<ISolrBasicOperations<TestDocument>>(); var mapper = mocks.CreateMock<IReadOnlyMappingManager>(); With.Mocks(mocks) .Expecting(basicServer.Ping) .Verify(() => { var s = new SolrServer<TestDocument>(basicServer, mapper); s.Ping(); }); }
public void Ping() { var basicServer = new MSolrBasicOperations<TestDocument> { ping = () => new ResponseHeader {QTime = 2}, }; var s = new SolrServer<TestDocument>(basicServer, null, null); var r = s.Ping(); Assert.AreEqual(2, r.QTime); }