Exemple #1
0
        public void When_Full_Redaction_Redact_Everything()
        {
            var ctx = new ClusterContext();

            ctx.ClusterOptions.RedactionLevel = RedactionLevel.Full;
            var redactor = new Redactor(ctx);

            Assert.Equal("<ud>user</ud>", redactor.UserData("user").ToString());
            Assert.Equal("<md>meta</md>", redactor.MetaData("meta").ToString());
            Assert.Equal("<sd>system</sd>", redactor.SystemData("system").ToString());
        }
Exemple #2
0
        public void When_User_Redaction_Redact_Partial()
        {
            var ctx = new ClusterContext();

            ctx.ClusterOptions.RedactionLevel = RedactionLevel.Partial;
            var redactor = new Redactor(ctx);

            Assert.Equal("<ud>user</ud>", redactor.UserData("user").ToString());
            Assert.Equal("meta", redactor.MetaData("meta").ToString());
            Assert.Equal("system", redactor.SystemData("system").ToString());
        }
Exemple #3
0
        public void When_Redaction_Disabled_No_Redaction_Occurs()
        {
            var ctx = new ClusterContext();

            ctx.ClusterOptions.RedactionLevel = RedactionLevel.None;
            var redactor = new Redactor(ctx);

            Assert.Equal("1", redactor.UserData("1").ToString());
            Assert.Null(redactor.MetaData(null));
            Assert.Equal("system", redactor.SystemData("system").ToString());
        }
Exemple #4
0
        public void When_Redaction_Disabled_No_Redaction_Occurs()
        {
            var options = new ClusterOptions
            {
                RedactionLevel = RedactionLevel.None
            };

            var redactor = new Redactor(options);

            Assert.Equal("1", redactor.UserData("1").ToString());
            Assert.Null(redactor.MetaData(null));
            Assert.Equal("system", redactor.SystemData("system").ToString());
        }
Exemple #5
0
        public void When_User_Redaction_Redact_Partial()
        {
            var options = new ClusterOptions
            {
                RedactionLevel = RedactionLevel.Partial
            };

            var redactor = new Redactor(options);

            Assert.Equal("<ud>user</ud>", redactor.UserData("user").ToString());
            Assert.Equal("meta", redactor.MetaData("meta").ToString());
            Assert.Equal("system", redactor.SystemData("system").ToString());
        }