<commit_before>﻿using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using WebbenVNext.Controllers;
using WebbenVNext.Models;
using WebbenVNext.Storage;

namespace WebbenVNext.Tests
{
    namespace WebbenVNext.Tests
    {
        [TestClass]
        public class HomeControllerTests
        {
            [TestMethod]
            public async Task HomeIndexSholdReturnFIlesFromBlobProvider()
            {
                var blobUrls = new[] { "/file1.png", "/file2.jpg" };
                var mockedBlob = new Mock<IBlobs>();
                mockedBlob
                    .Setup(x => x.GetAllBlobUrls())
                    .Returns(Task.FromResult(blobUrls.AsEnumerable()));

                var homeController = new HomeController(mockedBlob.Object);
                var homeIndexViewResult = await homeController.Index() as ViewResult;
                var homeIndexViewModel = homeIndexViewResult?.Model as HomeViewModel;
                var homeIndexViewModelBlobUrls = homeIndexViewModel?.BlobUrls.ToList();

                Assert.IsNotNull(homeIndexViewModelBlobUrls);
                Assert.AreEqual(blobUrls[0], homeIndexViewModelBlobUrls?[0]);
                Assert.AreEqual(blobUrls[1], homeIndexViewModelBlobUrls?[1]);
            }<commit_msg>Fixed small typo in HomeIndexSholdReturnFilesFromBlobProvider<commit_after>﻿using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using WebbenVNext.Controllers;
using WebbenVNext.Models;
using WebbenVNext.Storage;

namespace WebbenVNext.Tests
{
    namespace WebbenVNext.Tests
    {
        [TestClass]
        public class HomeControllerTests
        {
            [TestMethod]
            public async Task HomeIndexSholdReturnFilesFromBlobProvider()
            {
                var blobUrls = new[] { "/file1.png", "/file2.jpg" };
                var mockedBlob = new Mock<IBlobs>();
                mockedBlob
                    .Setup(x => x.GetAllBlobUrls())
                    .Returns(Task.FromResult(blobUrls.AsEnumerable()));

                var homeController = new HomeController(mockedBlob.Object);
                var homeIndexViewResult = await homeController.Index() as ViewResult;
                var homeIndexViewModel = homeIndexViewResult?.Model as HomeViewModel;
                var homeIndexViewModelBlobUrls = homeIndexViewModel?.BlobUrls.ToList();

                Assert.IsNotNull(homeIndexViewModelBlobUrls);
                Assert.AreEqual(blobUrls[0], homeIndexViewModelBlobUrls?[0]);
                Assert.AreEqual(blobUrls[1], homeIndexViewModelBlobUrls?[1]);
            }
{'fraction_non_alphanumeric': 0.08727272727272728, 'fraction_numerical': 0.004363636363636364, 'mean_word_length': 2.4955527318932655, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7580620', 'n_tokens_mistral': 755, 'n_tokens_neox': 721, 'n_words': 134}