public void Should_return_false_when_a_document_already_exists_with_the_same_id() { var car1 = new Car { Id = Guid.Empty, Make = "Kia", Model = "Niro 1.6 GDi Hybrid Comfortline", Year = 2016, Country = "Korea", Engine = "hybrid", Class = "suv", Price = 25995, Location = new GeoPosition(19.03991, 47.49801) }; var car2 = new Car { Id = Guid.Empty, Make = "Hyundai", Model = "Santa Fe 2.2 CRDi R 2WD Premium", Year = 2016, Country = "Korea", Engine = "diesel", Class = "suv", Price = 65022, Location = new GeoPosition(21.71671, 47.95539) }; var client = new RediSearchClient(Db); Assert.That(client.AddDocument(car1), Is.True); Assert.That(client.AddDocument(car2), Is.False); }
public void Should_return_false_when_index_does_not_exist() { var unexistingIndexTest = new UnexistingIndexTest { Id = 1 }; var client = new RediSearchClient(Db); Assert.That(client.AddDocument(unexistingIndexTest), Is.False); }
public void SetupConnection() { Connection = ConnectionMultiplexer.Connect("127.0.0.1"); Client = new RediSearchClient(Connection); CreateIndex(); foreach (var car in CarsDb) { Assert.That(Client.AddDocument(car), Is.True); } Assert.That(Client.AddDocument(new IgnoredPropertyTest() { Id = "id1", IgnoredProperty = "ignored", Property1 = "property1", Property2 = "property2" })); }
public void Should_return_true_if_successful() { var car = new Car { Id = Guid.NewGuid(), Make = "Kia", Model = "Niro 1.6 GDi Hybrid Comfortline", Year = 2016, Country = "Korea", Engine = "hybrid", Class = "suv", Price = 25995, Location = new GeoPosition(19.03991, 47.49801) }; var client = new RediSearchClient(Db); Assert.That(client.AddDocument(car), Is.True); }
public void SetupConnection() { Connection = ConnectionMultiplexer.Connect("127.0.0.1"); Client = new RediSearchClient(Connection); }