public void GetSearchSpaceMembers_EmptyResponse_EmptyListReturn() { Reset(); SearchSpace oSpace = new SearchSpace(_mockServer, "ObjectId"); _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), MethodType.GET, It.IsAny <ConnectionServerRest>(), It.IsAny <string>(), It.IsAny <bool>())).Returns(new WebCallResult { Success = true, ErrorText = "" }); var oList = oSpace.GetSearchSpaceMembers(true); BaseUnitTests.ClassInitialize(null); Assert.IsTrue(oList.Count == 0, "GetSearchSpaceMembers called with empty response should return an empty list"); }
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); }