예제 #1
0
        public void GetSchemaCommand()
        {
            var conn = new Mocks.MSolrConnection();

            conn.get += (url, kvs) => {
                Assert.AreEqual("/admin/file", url);
                var expectedKVs = new[] { KV.Create("file", "schema.xml") };
                Assert.AreElementsEqualIgnoringOrder(expectedKVs, kvs);
                return("");
            };
            var cmd = new GetSchemaCommand();

            cmd.Execute(conn);
            Assert.AreEqual(1, conn.get.Calls);
        }
예제 #2
0
        public void GetSchemaCommand()
        {
            var mocks = new MockRepository();
            var conn  = mocks.StrictMock <ISolrConnection>();

            With.Mocks(mocks).Expecting(delegate
            {
                Expect.Call(conn.Get("/admin/file", new List <KeyValuePair <string, string> > {
                    new KeyValuePair <string, string>("file", "schema.xml")
                })).Repeat.Once().Return("");
            }).Verify(delegate
            {
                var cmd = new GetSchemaCommand();
                cmd.Execute(conn);
            });
        }