public void DeleteSearchSpaceMember_EmptyClassData_Failure()
        {
            SearchSpace oSpace = new SearchSpace(_mockServer);
            var         res    = oSpace.DeleteSearchSpaceMember("PartitionObjectId");

            Assert.IsFalse(res.Success, "Calling DeleteSearchSpaceMember from empty class instance should fail");
        }
        public void DeleteSearchSpaceMember_ErrorResponse_Failure()
        {
            Reset();
            BaseUnitTests.Reset();
            _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), MethodType.DELETE, It.IsAny <ConnectionServerRest>(),
                                                        It.IsAny <string>(), It.IsAny <bool>())).Returns(new WebCallResult
            {
                Success      = false,
                ResponseText = "error text",
                StatusCode   = 404
            });

            var res = SearchSpace.DeleteSearchSpaceMember(_mockServer, "SSObjectId", "PartitionObjectID");

            Assert.IsFalse(res.Success, "Calling DeleteSearchSpaceMember with ErrorResponse did not fail");
        }
Пример #3
0
        public void SearchSpaceUpdateTests()
        {
            var res = _searchSpace.Update(_searchSpace.Name, _searchSpace.Description + "new");

            Assert.IsTrue(res.Success, "Update of SearchSpace description failed:" + res);

            //search space member functions
            List <Partition> oPartitions;

            res = Partition.GetPartitions(_connectionServer, out oPartitions);
            Assert.IsTrue(res.Success, "Fetching of partitions failed:" + res);
            Assert.IsTrue(oPartitions.Count > 0, "No partitions returned in search");

            res = _searchSpace.AddSearchSpaceMember(oPartitions[0].ObjectId, 99);
            Assert.IsTrue(res.Success, "Adding partition as search space member failed:" + res);
            Assert.IsTrue(_searchSpace.GetSearchSpaceMembers().Count == 1, "Search space member count not accurate after partition add:" + res);

            res = _searchSpace.DeleteSearchSpaceMember(oPartitions[0].ObjectId);
            Assert.IsTrue(res.Success, "Removing partition as search space member failed:" + res);

            res = SearchSpace.UpdateSearchSpace(_connectionServer, _searchSpace.ObjectId, "NewName" + Guid.NewGuid(), "NewDescription");
            Assert.IsTrue(res.Success, "Update of SearchSpace via static method failed:" + res);
        }
Пример #4
0
        public void DeleteSearchSpaceMember_InvalidObjectIds_Failure()
        {
            var res = SearchSpace.DeleteSearchSpaceMember(_connectionServer, "SearchSpaceId", "PartitionId");

            Assert.IsFalse(res.Success, "Static method for delete searchspace member did not fail with bogus search space and partition Id");
        }
        public void DeleteSearchSpaceMember_EmptySearchSpaceAndPartition_Failure()
        {
            var res = SearchSpace.DeleteSearchSpaceMember(_mockServer, "", "");

            Assert.IsFalse(res.Success, "Static method for delete searchspace member did not fail with blank search space and partition ids");
        }
        public void DeleteSearchSpaceMember_NullConnectionServer_Failure()
        {
            var res = SearchSpace.DeleteSearchSpaceMember(null, "SearchSpaceObjectId", "partitionObjectID");

            Assert.IsFalse(res.Success, "Static method for delete searchspace member did not fail with null Connection server ");
        }