<commit_before>using Nancy;
using Nancy.Testing;
using Xunit;

namespace LiGet.Tests
{
    public class PackagesNancyModuleTest
    {
        private Browser browser;

        public PackagesNancyModuleTest() {
            var bootstrapper = new TestBootstrapper();
            this.browser = new Browser(bootstrapper);
        }

        [Fact]
        public void UnknownPathRespons501() {
            var result = browser.Get("/api/v2/blah", with =>
            {
                with.HttpRequest();
            }).Result;
            Assert.Equal(HttpStatusCode.NotImplemented, result.StatusCode);
        }
    }
}<commit_msg>mock package repository in unit tests<commit_after>using System.Collections.Generic;
using Autofac;
using LiGet.Models;
using Moq;
using Nancy;
using Nancy.Testing;
using NuGet;
using Xunit;

namespace LiGet.Tests
{
    public class PackagesNancyModuleTest
    {
        private Browser browser;
        Mock<IPackageRepository> packageRepo;

        public PackagesNancyModuleTest() {
            packageRepo = new Mock<IPackageRepository>(MockBehavior.Strict);
            var bootstrapper = new TestBootstrapper(b => {
                b.RegisterInstance(packageRepo.Object).As<IPackageRepository>();
            });
            this.browser = new Browser(bootstrapper, ctx => ctx.HostName("testhost"));
        }

        [Fact]
        public void UnknownPathRespons501() {
            var result = browser.Get("/api/v2/blah", with =>
            {
                with.HttpRequest();
            }).Result;
            Assert.Equal(HttpStatusCode.NotImplemented, result.StatusCode);
        }
    }
}
{'fraction_non_alphanumeric': 0.09657701711491443, 'fraction_numerical': 0.004889975550122249, 'mean_word_length': 2.241584158415842, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 10, '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': '5207442', 'n_tokens_mistral': 449, 'n_tokens_neox': 435, 'n_words': 93}