using System.Threading.Tasks;
using MineTec.ProManager.Models.TokenAuth;
using MineTec.ProManager.Web.Controllers;
using Shouldly;
using Xunit;

namespace MineTec.ProManager.Web.Tests.Controllers
{
    public class HomeController_Tests: ProManagerWebTestBase
    {
        [Fact]
        public async Task Index_Test()
        {
            await AuthenticateAsync(null, new AuthenticateModel
            {
                UserNameOrEmailAddress = "admin",
                Password = "123qwe"
            });

            //Act
            var response = await GetResponseAsStringAsync(
                GetUrl<HomeController>(nameof(HomeController.Index))
            );

            //Assert
            response.ShouldNotBeNullOrEmpty();
        }
    }
}