public void should_get_file_archive()
        {
            // given
            var objectIds = new string[]
            {
                "FEA714C2-D61A-4871-8692-E0B37CDCDE35",
                "FEE6491B-9BFF-414A-A0C9-C83F9AA32EFB",
                "ECEFD027-EBED-49BB-A7A8-A428C4BA56EA"
            };

            var objectGuids = objectIds.Select(Guid.Parse).ToArray();
            var objects     = objectGuids.Select(TestTools.RandomPObject);
            var zip         = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 };

            _contextService.Setup(hs => hs.GetTokenActor(It.IsAny <HttpContext>())).Returns("sedov");
            var api = new Mock <IServerApiService>();

            api.Setup(a => a.GetObjects(objectGuids)).Returns(objects);
            _contextService.Setup(cs => cs.GetServerApi("sedov")).Returns(api.Object);
            _filesOperationService.Setup(fos => fos.CompressObjectsToArchive(objects, "sedov")).Returns(zip);

            // when
            var result = _controller.GetFileArchive(objectIds) as FileContentResult;

            // then
            Assert.AreEqual(zip, result.FileContents);
        }
        public void should_not_get_file_archive()
        {
            // given
            var contextService        = new Mock <IContextService>();
            var documentRender        = new Mock <IDocumentRender>();
            var fileStorage           = new Mock <IFilesStorage>();
            var fileSaver             = new Mock <IFileSaver>();
            var filesOperationService = new Mock <IFilesOperationService>();
            var controller            = new FilesController(
                contextService.Object,
                documentRender.Object,
                fileStorage.Object,
                fileSaver.Object,
                filesOperationService.Object);

            // then
            Assert.Throws <Exception>(() => controller.GetFileArchive(new string[0]));
        }