<commit_before>namespace dotless.Test.Unit.Handler
{
    using Core;
    using Core.Abstractions;
    using NUnit.Framework;
    using Rhino.Mocks;

    [TestFixture]
    public class HandlerFixture
    {
        private IPathProvider provider;
        private IRequest request;
        private IResponse response;
        private ILessEngine engine;

        [SetUp]
        public void SetUp()
        {
            provider = MockRepository.GenerateStub<IPathProvider>();
            request = MockRepository.GenerateStub<IRequest>();
            response = MockRepository.GenerateStub<IResponse>();
            engine = MockRepository.GenerateStub<ILessEngine>();
        }

        [Test]
        public void RetrievesPhysicalPathFromPathProvider()
        {
            var mock = MockRepository.GenerateMock<IPathProvider>();
            string path = "abc";
            request.Stub(p => p.LocalPath).Return(path);
            var impl = 
                new HandlerImpl(mock, request, response, engine);

            impl.Execute();

            mock.AssertWasCalled(p => p.MapPath(path));
        }

        [Test]
        public void RetrievesPathFromRequest()
        {
            var mock = MockRepository.GenerateMock<IRequest>();
            string path = "abc";

            var impl = new HandlerImpl(provider, mock, response, engine);

            impl.Execute();

            mock.AssertWasCalled(p => p.LocalPath);
        }
    }
}<commit_msg>Added test that verifies Engine gets called with correct Filepath<commit_after>namespace dotless.Test.Unit.Handler
{
    using Core;
    using Core.Abstractions;
    using NUnit.Framework;
    using Rhino.Mocks;

    [TestFixture]
    public class HandlerFixture
    {
        private IPathProvider provider;
        private IRequest request;
        private IResponse response;
        private ILessEngine engine;

        [SetUp]
        public void SetUp()
        {
            provider = MockRepository.GenerateStub<IPathProvider>();
            request = MockRepository.GenerateStub<IRequest>();
            response = MockRepository.GenerateStub<IResponse>();
            engine = MockRepository.GenerateStub<ILessEngine>();
        }

        [Test]
        public void RetrievesPhysicalPathFromPathProvider()
        {
            var mock = MockRepository.GenerateMock<IPathProvider>();
            string path = "abc";
            request.Stub(p => p.LocalPath).Return(path);
            var impl = 
                new HandlerImpl(mock, request, response, engine);

            impl.Execute();

            mock.AssertWasCalled(p => p.MapPath(path));
        }

        [Test]
        public void RetrievesPathFromRequest()
        {
            var mock = MockRepository.GenerateMock<IRequest>();
            string path = "abc";

            var impl = new HandlerImpl(provider, mock, response, engine);

            impl.Execute();

            mock.AssertWasCalled(p => p.LocalPath);
        }

        [Test]
        public void CallsEngineWithFilePath()
        {
            var mock = MockRepository.GenerateMock<ILessEngine>();
            string lessFile = "myLessfile.less";
            provider.Stub(p => p.MapPath(null)).IgnoreArguments().Return(lessFile);
            var impl = new HandlerImpl(provider, request, response, mock);

            impl.Execute();

            mock.AssertWasCalled(p => p.TransformToCss(lessFile));
        }
    }
}
{'fraction_non_alphanumeric': 0.09633294528521537, 'fraction_numerical': 0.0, 'mean_word_length': 2.0335392762577227, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 24, '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': '817978', 'n_tokens_mistral': 887, 'n_tokens_neox': 867, 'n_words': 191}