public async Task MakeAlgoPrivate(AlgoDataDTO algoData)
        {
            AddToPublicDTO addAlgo = new AddToPublicDTO()
            {
                AlgoId   = algoData.Id,
                ClientId = algoData.ClientId
            };
            var makeAlgoPrivateResponse = await Consumer.ExecuteRequest(ApiPaths.ALGO_STORE_REMOVE_FROM_PUBLIC, Helpers.EmptyDictionary, JsonUtils.SerializeObject(addAlgo), Method.POST);

            Assert.That(makeAlgoPrivateResponse.Status, Is.EqualTo(HttpStatusCode.OK));
        }
        public async Task ClientDataGetAllAlgos()
        {
            UploadStringDTO metadataForUploadedBinary = await UploadStringAlgo();

            string algoID = metadataForUploadedBinary.AlgoId;

            string url = ApiPaths.ALGO_STORE_ADD_TO_PUBLIC;

            MetaDataEntity metaDataEntity = await MetaDataRepository.TryGetAsync(t => t.Id == algoID) as MetaDataEntity;

            Assert.NotNull(metaDataEntity);

            AddToPublicDTO addAlgo = new AddToPublicDTO()
            {
                AlgoId   = algoID,
                ClientId = metaDataEntity.PartitionKey
            };

            var addAlgoToPublicEndpoint = await this.Consumer.ExecuteRequest(url, Helpers.EmptyDictionary, JsonUtils.SerializeObject(addAlgo), Method.POST);

            Assert.That(addAlgoToPublicEndpoint.Status, Is.EqualTo(HttpStatusCode.OK));

            url = ApiPaths.ALGO_STORE_CLIENT_DATA_GET_ALL_ALGOS;

            var clientDataAllAlgos = await this.Consumer.ExecuteRequest(url, Helpers.EmptyDictionary, null, Method.GET);

            Assert.That(clientDataAllAlgos.Status, Is.EqualTo(HttpStatusCode.OK));

            Object         responceclientDataAllAlgos = JsonUtils.DeserializeJson(clientDataAllAlgos.ResponseJson);
            List <AlgoDTO> listAllAlgos           = Newtonsoft.Json.JsonConvert.DeserializeObject <List <AlgoDTO> >(responceclientDataAllAlgos.ToString());
            AlgoDTO        expectedAlgoDTO        = listAllAlgos.FindLast(t => t.Id.Equals(algoID));
            string         AlgoIdFromGettAllAlgos = expectedAlgoDTO.Id;

            Assert.That(algoID, Is.EqualTo(AlgoIdFromGettAllAlgos));
            foreach (AlgoDTO algo in listAllAlgos)
            {
                Assert.Zero(expectedAlgoDTO.Rating);
                Assert.NotZero(expectedAlgoDTO.UsersCount);
                Assert.NotNull(expectedAlgoDTO.Id);
                Assert.NotNull(expectedAlgoDTO.Name);
                Assert.NotNull(expectedAlgoDTO.Description);
                Assert.NotNull(expectedAlgoDTO.Date);
                Assert.NotNull(expectedAlgoDTO.Author);
            }
        }
        public async Task CheckDatePublishedOnAlgoVisibilityChange()
        {
            // Create an algo
            AlgoDataDTO algoData = await CreateAlgo();

            // Get the test algo
            AlgoEntity algo = await AlgoRepository.TryGetAsync(algoData.ClientId, algoData.Id) as AlgoEntity;

            Assert.That(algoData.AlgoVisibility, Is.EqualTo(AlgoVisibility.Private));
            Assert.That(algoData.DatePublished, Is.Null);

            // Build the body for the request
            var model = new AddToPublicDTO
            {
                ClientId = algo.ClientId,
                AlgoId   = algo.AlgoId
            };

            // Change algo's visibility to 'public'
            var changeAlgoVisibility = await Consumer.ExecuteRequest(ApiPaths.ALGO_STORE_ADD_TO_PUBLIC, Helpers.EmptyDictionary, JsonUtils.SerializeObject(model), Method.POST);

            Assert.That(changeAlgoVisibility.Status, Is.EqualTo(HttpStatusCode.OK));

            // Get the test algo
            algo = await AlgoRepository.TryGetAsync(algoData.ClientId, algoData.Id) as AlgoEntity;

            // Check if the algo's visibility is successfully changed and DataPublished is available
            Assert.That(algo.AlgoVisibility, Is.EqualTo(AlgoVisibility.Public));
            Assert.That(algo.DatePublished.Value, Is.EqualTo(DateTime.UtcNow).Within(3).Minutes);

            // Change the current algo's visibility to be 'private'
            changeAlgoVisibility = await Consumer.ExecuteRequest(ApiPaths.ALGO_STORE_REMOVE_FROM_PUBLIC, Helpers.EmptyDictionary, JsonUtils.SerializeObject(model), Method.POST);

            Assert.That(changeAlgoVisibility.Status, Is.EqualTo(HttpStatusCode.OK));

            // Get the test algo with the changes
            algo = await AlgoRepository.TryGetAsync(algoData.ClientId, algoData.Id) as AlgoEntity;

            //Check if the algo's visibility is 'private' and DatePublished is NULL
            Assert.That(algo.AlgoVisibility, Is.EqualTo(AlgoVisibility.Private));
            Assert.That(algo.DatePublished, Is.Null);
        }