Example #1
0
        public void AAdminShouldBeAbleToReadAllJsonFilesInRoleBasedSecurityContext()
        {
            IFileReader   fileReader         = new JsonFileReader();
            Authorization adminAuthorization = new AdminAuthorization(fileReader);

            var filename = $@"{_currentDirectory}\files\admin.json";

            var actual = adminAuthorization.Read(filename);

            Assert.AreEqual("{\r\n  \"text\": \"Hello admin!\"\r\n}", actual.ToString());
        }
Example #2
0
        public void AAdminShouldBeAbleToReadAllXMLFilesInRoleBasedSecurityContext()
        {
            IFileReader   fileReader         = new XmlFileReader();
            Authorization adminAuthorization = new AdminAuthorization(fileReader);

            var filename = $@"{_currentDirectory}\files\admin.xml";

            var actual = XElement.Parse(adminAuthorization.Read(filename));

            var expected = XElement.Parse("<?xml version=\"1.0\"?><text>Hello admin!</text>");

            Assert.AreEqual(expected.ToString(), actual.ToString());
        }