<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using SalaryCalculatorWeb;
using SalaryCalculatorWeb.Controllers;
using NUnit.Framework;
using Moq;
using SalaryCalculator.Configuration.Caching;
using SalaryCalculator.Data.Services.Contracts;
using SalaryCalculatorWeb.Models.HomeViewModels;

namespace SalaryCalculatorWeb.Tests.Controllers.HomeControllerTests
{
    [TestFixture]
    public class Information_Should
    {
        [Test]
        public void ReturnPartialViewResult()
        {
            // Arrange
            var cacheService = new Mock<ICacheService>();
            var userService = new Mock<IUserService>();
            var paycheckService = new Mock<IEmployeePaycheckService>();
            var billService = new Mock<IRemunerationBillService>();
            var selfEmploymentService = new Mock<ISelfEmploymentService>();
            HomeController controller = new HomeController(cacheService.Object, userService.Object, paycheckService.Object, billService.Object,selfEmploymentService.Object);

            var infoViewModel = new Mock<InfoViewModel>();
            // Act
            PartialViewResult result = controller.Information(infoViewModel.Object) as PartialViewResult;

            // Assert
            Assert.IsInstanceOf<PartialViewResult>(result);
        }
    }
}<commit_msg>setup mocks<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using SalaryCalculatorWeb;
using SalaryCalculatorWeb.Controllers;
using NUnit.Framework;
using Moq;
using SalaryCalculator.Configuration.Caching;
using SalaryCalculator.Data.Services.Contracts;
using SalaryCalculatorWeb.Models.HomeViewModels;

namespace SalaryCalculatorWeb.Tests.Controllers.HomeControllerTests
{
    [TestFixture]
    public class Information_Should
    {
        [Test]
        public void ReturnPartialViewResult()
        {
            // Arrange
            var cacheService = new Mock<ICacheService>();
            var userService = new Mock<IUserService>();
            var paycheckService = new Mock<IEmployeePaycheckService>();
            var billService = new Mock<IRemunerationBillService>();
            var selfEmploymentService = new Mock<ISelfEmploymentService>();
            HomeController controller = new HomeController(cacheService.Object, userService.Object, paycheckService.Object, billService.Object,selfEmploymentService.Object);

            cacheService.Setup(x => x.Get("t1", () => userService.Object.GetAll().Count(), 60)).Returns(2);
            cacheService.Setup(x => x.Get("t1", () => paycheckService.Object.GetAll().Count(), 60)).Returns(2);
            cacheService.Setup(x => x.Get("t1", () => billService.Object.GetAll().Count(), 60)).Returns(2);
            cacheService.Setup(x => x.Get("t1", () => selfEmploymentService.Object.GetAll().Count(), 60)).Returns(2);
            var infoViewModel = new Mock<InfoViewModel>();

            // Act
            PartialViewResult result = controller.Information(infoViewModel.Object) as PartialViewResult;

            // Assert
            Assert.IsInstanceOf<PartialViewResult>(result);
        }
    }
}
{'fraction_non_alphanumeric': 0.10337356855462705, 'fraction_numerical': 0.004952027236149799, 'mean_word_length': 3.385345997286296, 'pattern_counts': {'":': 0, '<': 17, '<?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': '4337788', 'n_tokens_mistral': 867, 'n_tokens_neox': 842, 'n_words': 165}