Пример #1
0
        public async Task Controller_POST()
        {
            var controller = new LangController(Manager, User);

            var mdl = await controller.PostLang(new LangCreate()
            {
                Name = "C"
            }) as JsonResult;

            var obj = mdl.Value as Models.Output.Symbols.Lang;

            Assert.AreEqual(1, obj.Id);
            Assert.AreEqual("C", obj.Name);

            Assert.ThrowsAsync <Shared.Exceptions.ResourceAlreadyExists>(() => controller.PostLang(new LangCreate()
            {
                Name = "C"
            }));

            User.SetPermissions(new string[] { });
            Assert.ThrowsAsync <Shared.Exceptions.InsuficientPermission>(() => controller.PostLang(new LangCreate()));
        }
Пример #2
0
        public async Task Controller_Icon()
        {
            var controller = new LangController(Manager, User);
            await controller.PostLang(new LangCreate()
            {
                Name = "C"
            });

            Assert.ThrowsAsync <Shared.Exceptions.ResourceNotFound>(() => controller.GetIcon(1));

            var str    = "/9j/4AAQSkZJRgABAQEAZABkAAD/4SinRXhpZgAATU0AKgAAAAgADAEAAAMAAAABDYAAAAEBAAMAAAABDYAAAAEPAAIAAAAIAAAAngEQAAIAAAAOAAAApgESAAMAAAABAAEAAAEaAAUAAAABAAAAtAEbAAUAAAABAAAAvAEoAAMAAAABAAIAAAEyAAIAAAAUAAAAxAITAAMAAAABAAEAAIdpAAQAAAABAAAA2IglAAQAAAABAAAC8AAAA8pPbmVQbHVzAE9ORVBMVVMgQTYwMDMAAAAAZAAAAAEAAABkAAAAATIwMTk6MDc6MTMgMjM6MTM6NDUAAB+CmgAFAAAAAQAAAlKCnQAFAAAAAQAAAlqIIgADAAAAAQACAACIJwADAAAAASWAAACQAAAHAAAABDAyMjCQAwACAAAAFAAAAmKQBAACAAAAFAAAAnaRAQAHAAAABAECAwCSAQAKAAAAAQAAAoqSAgAFAAAAAQAAApKSAwAKAAAAAQAAApqSBAAKAAAAAQAAAqKSBQAFAAAAAQAAAqqSBwADAAAAAQABAACSCAADAAAAAQAAAACSCQADAAAAAQAQAACSCgAFAAAAAQAAArKSkAACAAAABwAAArqSkQACAAAABwAAAsKSkgACAAAABwAA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2ICjbjcXpJNbZYZE17xad/yl+Tl6nLiyP6Irke6Xdex18drMoOtmTEJxSexh26mxmBYIB3FbAgAEFDLDlljbVKUH/VF9GYgI25YR5efE7h6Pqvk1IsJODtGbUZ/VDb1QGAFdgAIjJreh5cu9L7gIq3u0vkcq/uTCj13Q3TpAY+xU2it31JTAtp9diEKrAlCi9gAIikAAAigAAAEAoAAAECA+QCjIMACAAKdgAAKgABEAECgBYIdAACfqAARB2AAAAALAACLcd1swAjlafU4Y28+BZPa2v8AwaMksbnJwXLFvZeiAGBcV6scy/tAAnN7IlgAE36iwAAAAAAECAEAAAAAAAABAALAgAQABR//2Q==";
            var stream = new MemoryStream(Convert.FromBase64String(str));

            stream.Position = 0;

            await controller.PostIcon(1, new FileController.FormFile()
            {
                File = new FormFile(stream, 0, stream.Length, null, "Image.jpeg")
            });

            Assert.IsNotNull(Context.SymbolLangs.First().Icon);
            Assert.IsNotEmpty(Context.SymbolLangs.First().Icon);

            var mdl = await controller.GetIcon(1) as JsonResult;

            var iconb64 = mdl.Value as string;

            Assert.IsNotNull(iconb64);
            Assert.IsNotEmpty(iconb64);
            Assert.Less(iconb64.Length, str.Length);
            Assert.IsTrue(iconb64.StartsWith("image/jpeg,"));

            var data = Manager.LangManager.GetFile(Context.SymbolLangs.First());

            Assert.AreEqual("image/jpeg", data.ContentType);
            Assert.Greater(data.Length, 0);
            Assert.AreEqual("Image", data.Name);

            User.SetPermissions(new string[] { });
            Assert.ThrowsAsync <Shared.Exceptions.InsuficientPermission>(() => controller.PostIcon(1, null));
        }
Пример #3
0
        public async Task Controller_DELETE()
        {
            var controller = new LangController(Manager, User);

            var mdl = await controller.PostLang(new LangCreate()
            {
                Name = "C"
            }) as JsonResult;

            var obj = mdl.Value as Models.Output.Symbols.Lang;

            Assert.AreEqual(1, obj.Id);
            Assert.AreEqual("C", obj.Name);
            Assert.AreEqual(1, Context.SymbolLangs.Count());

            await controller.DeleteLang(1);

            Assert.AreEqual(0, Context.SymbolLangs.Count());

            User.SetPermissions(new string[] { });
            Assert.ThrowsAsync <Shared.Exceptions.InsuficientPermission>(() => controller.DeleteLang(1));
        }