Ejemplo n.º 1
0
        private async Task <Guid> AddFile(bool isPublic, string fileName, Guid parentId)
        {
            var fileId = ProcessRecordsFile(JohnId.ToString(), fileName, new Dictionary <string, object>()
            {
                { "parentId", parentId }
            }).Result;

            await ChangeShareFile(fileId, isPublic);

            var recordsId = await Records.FindAsync(new BsonDocument("FileId", fileId))
                            .GetAwaiter()
                            .GetResult()
                            .ToListAsync();

            foreach (var record in recordsId)
            {
                if (!_testFixture.InternalIds.Contains((Guid)record._id))
                {
                    _testFixture.InternalIds.Add(record._id);
                }
            }
            //  InternalIds.AddRange(recordsId.Select(x => (Guid)x._id));

            if (!_testFixture.InternalIds.Contains((Guid)fileId))
            {
                _testFixture.InternalIds.Add(fileId);
            }

            return(fileId);
        }