File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ <Project Sdk =" Microsoft.NET.Sdk" >
2
+
3
+ <PropertyGroup >
4
+ <TargetFramework >netcoreapp2.2</TargetFramework >
5
+
6
+ <IsPackable >false</IsPackable >
7
+ </PropertyGroup >
8
+
9
+ <ItemGroup >
10
+ <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 15.9.0" />
11
+ <PackageReference Include =" MSTest.TestAdapter" Version =" 1.3.2" />
12
+ <PackageReference Include =" MSTest.TestFramework" Version =" 1.3.2" />
13
+ </ItemGroup >
14
+
15
+ </Project >
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using Microsoft . AspNetCore . Mvc ;
3
+ using Microsoft . VisualStudio . TestTools . UnitTesting ;
4
+ using pipelines_dotnet_core . Controllers ;
5
+
6
+ namespace dotnetcore_tests
7
+ {
8
+ [ TestClass ]
9
+ public class UnitTest1
10
+ {
11
+ [ TestMethod ]
12
+ public void About ( )
13
+ {
14
+ // Arrange
15
+ HomeController controller = new HomeController ( ) ;
16
+
17
+ // Act
18
+ ViewResult result = controller . About ( ) as ViewResult ;
19
+
20
+ // Assert
21
+ Assert . AreEqual ( "Your application description page." , result . ViewData [ "Message" ] ) ;
22
+ }
23
+
24
+ [ TestMethod ]
25
+ public void Contact ( )
26
+ {
27
+ // Arrange
28
+ HomeController controller = new HomeController ( ) ;
29
+
30
+ // Act
31
+ ViewResult result = controller . Contact ( ) as ViewResult ;
32
+
33
+ // Assert
34
+ Assert . AreEqual ( "Your contact pagess." , result . ViewData [ "Message" ] ) ;
35
+ }
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments