Skip to content

Commit

Permalink
Project Init
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Davydov committed Mar 2, 2019
0 parents commit 051df72
Show file tree
Hide file tree
Showing 14 changed files with 254 additions and 0 deletions.
41 changes: 41 additions & 0 deletions NewTypes/NewTypes.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ADACD08B-1485-4609-A59A-C8BDAD9A1E92}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E3C8E138-429E-4EDE-996F-CCA2F0E8050C}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "NewTypes", "src\NewTypes\NewTypes.xproj", "{DC079B7C-9221-4F9A-BEBD-80E11E8CBD87}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{2450C54E-85F0-480F-BC8A-862EC0DF528E}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "NewTypes.Tests", "test\NewTypes.Tests\NewTypes.Tests.xproj", "{846C62FF-AD3F-44F2-B0AF-8DB68433D9DE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DC079B7C-9221-4F9A-BEBD-80E11E8CBD87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC079B7C-9221-4F9A-BEBD-80E11E8CBD87}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC079B7C-9221-4F9A-BEBD-80E11E8CBD87}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC079B7C-9221-4F9A-BEBD-80E11E8CBD87}.Release|Any CPU.Build.0 = Release|Any CPU
{846C62FF-AD3F-44F2-B0AF-8DB68433D9DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{846C62FF-AD3F-44F2-B0AF-8DB68433D9DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{846C62FF-AD3F-44F2-B0AF-8DB68433D9DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{846C62FF-AD3F-44F2-B0AF-8DB68433D9DE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{DC079B7C-9221-4F9A-BEBD-80E11E8CBD87} = {ADACD08B-1485-4609-A59A-C8BDAD9A1E92}
{846C62FF-AD3F-44F2-B0AF-8DB68433D9DE} = {2450C54E-85F0-480F-BC8A-862EC0DF528E}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions NewTypes/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-preview2-003131"
}
}
21 changes: 21 additions & 0 deletions NewTypes/src/NewTypes/NewTypes.xproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>

<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>dc079b7c-9221-4f9a-bebd-80e11e8cbd87</ProjectGuid>
<RootNamespace>NewTypes</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
</PropertyGroup>

<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
12 changes: 12 additions & 0 deletions NewTypes/src/NewTypes/Pets/Cat.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace NewTypes.Pets
{
public class Cat : IPet
{
public string TalkToOwner() => "Meow!";
}
}
12 changes: 12 additions & 0 deletions NewTypes/src/NewTypes/Pets/Dog.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace NewTypes.Pets
{
public class Dog : IPet
{
public string TalkToOwner() => "Woof!";
}
}
12 changes: 12 additions & 0 deletions NewTypes/src/NewTypes/Pets/IPet.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace NewTypes.Pets
{
public interface IPet
{
string TalkToOwner();
}
}
25 changes: 25 additions & 0 deletions NewTypes/src/NewTypes/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using NewTypes.Pets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace NewTypes
{
public class Program
{
public static void Main(string[] args)
{
List<IPet> pets = new List<IPet>
{
new Dog(),
new Cat()
};

foreach (var pet in pets)
{
Console.WriteLine(pet.TalkToOwner());
}
}
}
}
19 changes: 19 additions & 0 deletions NewTypes/src/NewTypes/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NewTypes")]
[assembly: AssemblyTrademark("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("dc079b7c-9221-4f9a-bebd-80e11e8cbd87")]
15 changes: 15 additions & 0 deletions NewTypes/src/NewTypes/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "1.0.0-*",
"dependencies": { },
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
}
},
"imports": "dnxcore50"
}
}
}
21 changes: 21 additions & 0 deletions NewTypes/test/NewTypes.Tests/NewTypes.Tests.xproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>

<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>846c62ff-ad3f-44f2-b0af-8db68433d9de</ProjectGuid>
<RootNamespace>NewTypes.Tests</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
</PropertyGroup>

<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
30 changes: 30 additions & 0 deletions NewTypes/test/NewTypes.Tests/PetTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using NewTypes.Pets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xunit;

namespace NewTypes.Tests
{
public class PetTests
{
[Fact]
public void DogTalkToOwnerTest()
{
string expected = "Woof!";
string actual = new Dog().TalkToOwner();

Assert.Equal(expected, actual);
}

[Fact]
public void CatTalkToOwner()
{
string expected = "Meow!";
string actual = new Cat().TalkToOwner();

Assert.Equal(expected, actual);
}
}
}
19 changes: 19 additions & 0 deletions NewTypes/test/NewTypes.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NewTypes.Tests")]
[assembly: AssemblyTrademark("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("846c62ff-ad3f-44f2-b0af-8db68433d9de")]
20 changes: 20 additions & 0 deletions NewTypes/test/NewTypes.Tests/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": "1.0.0-*",
"testRunner": "xunit",
"dependencies": {
"dotnet-test-xunit": "2.2.0-preview2-build1029",
"NewTypes": "1.0.0",
"xunit": "2.2.0-beta4-build3444"
},
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
}
},
"imports": "dnxcore50"
}
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# dotnet-simple-project-example-with-tests

0 comments on commit 051df72

Please sign in to comment.