Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Microsoft.VisualStudio.TestTools.UnitTesting;
- using Academy.Models;
- namespace Academy.Tests.CourseTests
- {
- [TestClass]
- public class Name_Tests
- {
- DateTime? start = new DateTime(2019, 02, 18);
- DateTime? end = new DateTime(2019, 02, 28);
- [TestMethod]
- public void ThrowWhenNameIsNull()
- {
- // Arrange, Act, Assert
- Assert.ThrowsException<ArgumentException>(() => new Course(null, 5, start, end));
- }
- [TestMethod]
- public void ThrowWhenNameIsSmallerThanMinValue()
- {
- // Arrange, Act, Assert
- Assert.ThrowsException<ArgumentException>(() => new Course("aa", 5, start, end));
- }
- [TestMethod]
- public void ThrowWhenNameIsLargerThanMaxValue()
- {
- // Arrange, Act, Assert
- Assert.ThrowsException<ArgumentException>(() => new Course(new string('a', 46), 5, start, end));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement