CapRaffle.UnitTests.AccountControllerTests.Can_Not_Register_Without_Valid_Email C# (CSharp) Method

Can_Not_Register_Without_Valid_Email() private method

private Can_Not_Register_Without_Valid_Email ( ) : void
return void
        public void Can_Not_Register_Without_Valid_Email()
        {
            //Arrange
            User model = new User
            {
                Email = "test",
                Password = "12"
            };

            // Act
            accountController.ModelState.AddModelError("error", "Email must end with @capgemini.com");
            ActionResult res = accountController.Register(model);

            // Assert
            Assert.IsInstanceOf(typeof(ViewResult), res);
            Assert.IsFalse(((ViewResult)res).ViewData.ModelState.IsValid);
        }