|
|
- using Microsoft.VisualStudio.TestTools.UnitTesting;
- using Sevomin.WebFrontend.Controllers;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Web.Mvc;
-
- namespace Sevomin.Tests.Controllers.Job
- {
- [TestClass]
- public class NewJob
- {
- public JobController GetCUT()
- {
- JobController cut = new JobController();
- return cut;
- }
-
- [TestMethod]
- public void Returns_View_NewJob_JobController()
- {
- // Arrange
- JobController cut = GetCUT();
- // Act
- var result = cut.NewJob() as ViewResult;
- // Assert
- Assert.IsNotNull(result);
- Assert.AreEqual(string.Empty, result.ViewName);
- }
-
- [TestMethod]
- public void Returns_EmptyJobModel_NewJob_JobController()
- {
- // Arrange
- JobController cut = GetCUT();
- // Act
- var result = cut.NewJob() as ViewResult;
- // Assert
- Assert.IsNotNull(result);
- Assert.IsNotNull(result.Model);
- Assert.IsInstanceOfType(result.Model, typeof(Models.Job));
- Assert.AreNotEqual((result.Model as Models.Job).JobParameters.Count, 0);
- }
- }
- }
|