<commit_before>﻿namespace NelitaBeautyStudio.Tests.ControllerTests
{
    using System.Linq;
    using System.Web.Mvc;

    using NelitaBeautyStudio.Tests.ControllerTests.Data;
    using NelitaBeautyStudio.Web.Controllers;
    using NUnit.Framework;
    using NelitaBeautyStudio.Models;
    using System.Collections.Generic;
    using NelitaBeautyStudio.Web.ViewModels;

    [TestFixture]
    public class ContactsControllerTests
    {
        private ContactsController controller { get; set; }

        [TestFixtureSetUp]
        public void Init()
        {
            controller = new ContactsController(new FakeApplicationData());
        }

        [Test]
        public void IndexShouldReturnCorrectView()
        {
            var result = controller.Index() as ViewResult;

            Assert.AreEqual("Index", result.ViewName);
        }

        [Test]
        public void IndexShouldReturnModel()
        {
            var result = controller.Index() as ViewResult;

            Assert.IsNotNull(result.Model);
        }

        [Test]
        public void IndexShouldReturnSortedModel()
        {
            var result = controller.Index() as ViewResult;
            var model = (List<Contact>)result.Model;
            var sortedModel = model.OrderByDescending(c => c.Priority)
                .ThenBy(c => c.Type);

            Assert.AreEqual(model, sortedModel);
        }

        //[Test]
        //public void CreateValidContactShouldRedirectToIndex()
        //{
        //    var contact = new ContactViewModel() 
        //    {
        //        Priority = Priority.Low, 
        //        Type = "telefona na pesho", 
        //        Value = "1432567536245"
        //    };

        //    var result = (RedirectToRouteResult)controller.Create(contact);

        //    Assert.AreEqual("Index", "");
        //}
    }
}
<commit_msg>StyleCop errors have been fixed.<commit_after>﻿namespace NelitaBeautyStudio.Tests.ControllerTests
{
    using System.Collections.Generic;
    using System.Linq;
    using System.Web.Mvc;

    using NelitaBeautyStudio.Models;
    using NelitaBeautyStudio.Tests.ControllerTests.Data;
    using NelitaBeautyStudio.Web.Controllers;
    
    using NUnit.Framework;

    [TestFixture]
    public class ContactsControllerTests
    {
        private ContactsController Controller { get; set; }

        [TestFixtureSetUp]
        public void Init()
        {
            this.Controller = new ContactsController(new FakeApplicationData());
        }

        [Test]
        public void IndexShouldReturnCorrectView()
        {
            var result = this.Controller.Index() as ViewResult;

            Assert.AreEqual("Index", result.ViewName);
        }

        [Test]
        public void IndexShouldReturnModel()
        {
            var result = this.Controller.Index() as ViewResult;

            Assert.IsNotNull(result.Model);
        }

        [Test]
        public void IndexShouldReturnSortedModel()
        {
            var result = this.Controller.Index() as ViewResult;
            var model = (List<Contact>)result.Model;
            var sortedModel = model.OrderByDescending(c => c.Priority)
                .ThenBy(c => c.Type);

            Assert.AreEqual(model, sortedModel);
        }

        ////[Test]
        ////public void CreateValidContactShouldRedirectToIndex()
        ////{
        ////    var contact = new ContactViewModel() 
        ////    {
        ////        Priority = Priority.Low, 
        ////        Type = "telefona na pesho", 
        ////        Value = "1432567536245"
        ////    };

        ////    var result = (RedirectToRouteResult)controller.Create(contact);

        ////    Assert.AreEqual("Index", "");
        ////}
    }
}

{'fraction_non_alphanumeric': 0.10531943330660251, 'fraction_numerical': 0.006950013365410318, 'mean_word_length': 1.8241509433962264, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '3523074', 'n_tokens_mistral': 1054, 'n_tokens_neox': 993, 'n_words': 194}