<commit_before>using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Web.Mvc;
using System.Web.Routing;
using FluentSecurity.Configuration;
using FluentSecurity.Internals;
using FluentSecurity.Policy;
using FluentSecurity.Policy.Results;
using FluentSecurity.Specification.TestData;
using Moq;

namespace FluentSecurity.Specification.Helpers
{
	public static class TestDataFactory
	{
		public const string ValidControllerName = "SomeController";
		public const string ValidActionName = "SomeAction";

		public static readonly Func<bool> ValidIsAuthenticatedFunction = () => true;
		public static readonly Func<IEnumerable<object>> ValidRolesFunction = () => new object[0];

		public static ISecurityContext CreateSecurityContext(bool authenticated, IEnumerable<object> roles = null)
		{
			var data = new ExpandoObject();
			var context = new Mock<ISecurityContext>();
			context.Setup(x => x.Runtime).Returns(CreateSecurityRuntime());
			context.Setup(x => x.Data).Returns(data);
			context.Setup(x => x.CurrentUserIsAuthenticated()).Returns(authenticated);
			context.Setup(x => x.CurrentUserRoles()).Returns(roles);
			return context.Object;
		}

		public static ISecurityRuntime CreateSecurityRuntime()
		{
			return new SecurityRuntime();
		}

		public static PolicyContainer CreateValidPolicyContainer()
		{
			return new PolicyContainer(
				ValidControllerName,
				ValidActionName,
				CreateValidPolicyAppender());
		}

		public static PolicyContainer CreateValidPolicyContainer(string controllerName, string actionName)
		{
			return new PolicyContainer(
				controllerName ?? ValidControllerName,
				actionName ?? ValidActionName,
				CreateValidPolicyAppender());
		}

		public static SecurityConfiguration CreateValidSecurityConfiguration()<commit_msg>- Added empty RouteValueDictionary to Data property in TestDataFactory CreateSecurityContext. - Removed unused using statement.<commit_after>using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Web.Mvc;
using System.Web.Routing;
using FluentSecurity.Configuration;
using FluentSecurity.Internals;
using FluentSecurity.Policy;
using FluentSecurity.Specification.TestData;
using Moq;

namespace FluentSecurity.Specification.Helpers
{
	public static class TestDataFactory
	{
		public const string ValidControllerName = "SomeController";
		public const string ValidActionName = "SomeAction";

		public static readonly Func<bool> ValidIsAuthenticatedFunction = () => true;
		public static readonly Func<IEnumerable<object>> ValidRolesFunction = () => new object[0];

		public static ISecurityContext CreateSecurityContext(bool authenticated, IEnumerable<object> roles = null)
		{
			dynamic data = new ExpandoObject();
			data.RouteValues = new RouteValueDictionary();
			var context = new Mock<ISecurityContext>();
			context.Setup(x => x.Runtime).Returns(CreateSecurityRuntime());
			context.Setup(x => x.Data).Returns(data as ExpandoObject);
			context.Setup(x => x.CurrentUserIsAuthenticated()).Returns(authenticated);
			context.Setup(x => x.CurrentUserRoles()).Returns(roles);
			return context.Object;
		}

		public static ISecurityRuntime CreateSecurityRuntime()
		{
			return new SecurityRuntime();
		}

		public static PolicyContainer CreateValidPolicyContainer()
		{
			return new PolicyContainer(
				ValidControllerName,
				ValidActionName,
				CreateValidPolicyAppender());
		}

		public static PolicyContainer CreateValidPolicyContainer(string controllerName, string actionName)
		{
			return new PolicyContainer(
				controllerName ?? ValidControllerName,
				actionName ?? ValidActionName,
				CreateValidPolicyAppender());
		}

		public static SecurityConfiguration CreateValidSecurityConfiguration()
{'fraction_non_alphanumeric': 0.08823529411764706, 'fraction_numerical': 0.0005347593582887701, 'mean_word_length': 5.7405405405405405, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4039775', 'n_tokens_mistral': 1086, 'n_tokens_neox': 961, 'n_words': 241}