Example #1
0
        public JobApplicationControllerTest()
        {
            _httpMessageHandler = Substitute.ForPartsOf <FakeHttpMessageHandler>();

            var httpClient = new HttpClient(_httpMessageHandler)
            {
                BaseAddress = new Uri("http://localhost/api/")
            };

            _httpRequestMessage = new HttpRequestMessage();
            _httpMessageHandler.WhenForAnyArgs(x => x.Send(_httpRequestMessage)).DoNotCallBase();

            _jobApplicationsController = new JobApplicationsController(httpClient);

            _expectedJobApplications = new List <JobApplication>
            {
                new JobApplication
                {
                    CompanyName     = "Company 1",
                    ApplicationDate = new DateTime(2017, 11, 13),
                    Status          = Status.Interview
                },
                new JobApplication
                {
                    CompanyName     = "Company 2",
                    ApplicationDate = new DateTime(2017, 11, 14),
                    Status          = Status.Applied
                },
                new JobApplication
                {
                    CompanyName     = "Company 3",
                    ApplicationDate = new DateTime(2017, 11, 14),
                    Status          = Status.Offer
                }
            };
        }