public void RemoveServer_Throws()
        {
            // GIVEN
            const string serverId = "server-001";

            // WHEN THEN
            Assert.Throws <HangfireElasticSearchException>(() => _elasticConnection.RemoveServer(serverId));
        }
Ejemplo n.º 2
0
        public void RemoveServer_WithExistingServer_RemovesServer()
        {
            // GIVEN
            const string serverId = "server-001";

            _elasticClient.Index(new Model.Server {
                Id = serverId
            }, descr => descr.Refresh(Refresh.True)).ThrowIfInvalid();

            // WHEN
            _elasticConnection.RemoveServer(serverId);

            // THEN
            var getServerResponse = _elasticClient.Get <Model.Server>(serverId).ThrowIfInvalid();

            getServerResponse.Found.Should().BeFalse();
        }