Skip to content

Commit

Permalink
Merge pull request #485 from stakx/cleanup
Browse files Browse the repository at this point in the history
Clean up solution and build script regarding unit test projects
  • Loading branch information
stakx authored Oct 14, 2017
2 parents ea083c6 + fd51023 commit bc40732
Show file tree
Hide file tree
Showing 74 changed files with 66 additions and 692 deletions.
File renamed without changes.
19 changes: 19 additions & 0 deletions Moq.Tests.VisualBasic/Moq.Tests.VisualBasic.vbproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
<AssemblyOriginatorKeyFile>../Moq.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="xunit" Version="2.3.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Source\Moq.csproj" />
</ItemGroup>

</Project>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void ShouldReturnEmptyArrayOnLoose()
var mock = new Mock<IFoo>(MockBehavior.Loose);

Assert.NotNull(mock.Object.GetArray());
Assert.Equal(0, mock.Object.GetArray().Length);
Assert.Empty(mock.Object.GetArray());
}

[Fact]
Expand All @@ -56,7 +56,7 @@ public void ShouldReturnEmptyArrayTwoDimensionsOnLoose()
var mock = new Mock<IFoo>(MockBehavior.Loose);

Assert.NotNull(mock.Object.GetArrayTwoDimensions());
Assert.Equal(0, mock.Object.GetArrayTwoDimensions().Length);
Assert.Empty(mock.Object.GetArrayTwoDimensions());
}

[Fact]
Expand All @@ -73,7 +73,7 @@ public void ShouldReturnEmptyEnumerableStringOnLoose()
var mock = new Mock<IFoo>(MockBehavior.Loose);

Assert.NotNull(mock.Object.GetEnumerable());
Assert.Equal(0, mock.Object.GetEnumerable().Count());
Assert.Empty(mock.Object.GetEnumerable());
}

[Fact]
Expand All @@ -82,7 +82,7 @@ public void ShouldReturnEmptyEnumerableObjectsOnLoose()
var mock = new Mock<IFoo>(MockBehavior.Loose);

Assert.NotNull(mock.Object.GetEnumerableObjects());
Assert.Equal(0, mock.Object.GetEnumerableObjects().Cast<object>().Count());
Assert.Empty(mock.Object.GetEnumerableObjects().Cast<object>());
}

[Fact]
Expand Down Expand Up @@ -140,7 +140,7 @@ public void ReturnsEmptyArrayOnLooseWithMockDefaultValue()
var mock = new Mock<IFoo>(MockBehavior.Loose) { DefaultValue = DefaultValue.Mock };

Assert.NotNull(mock.Object.GetArray());
Assert.Equal(0, mock.Object.GetArray().Length);
Assert.Empty(mock.Object.GetArray());
}

[Fact]
Expand All @@ -149,7 +149,7 @@ public void ReturnsEmptyArrayTwoDimensionsOnLooseWithMockDefaultValue()
var mock = new Mock<IFoo>(MockBehavior.Loose) { DefaultValue = DefaultValue.Mock };

Assert.NotNull(mock.Object.GetArrayTwoDimensions());
Assert.Equal(0, mock.Object.GetArrayTwoDimensions().Length);
Assert.Empty(mock.Object.GetArrayTwoDimensions());
}

[Fact]
Expand All @@ -172,7 +172,7 @@ public void ReturnsEmptyEnumerableStringOnLooseWithMockDefaultValue()
var mock = new Mock<IFoo>(MockBehavior.Loose) { DefaultValue = DefaultValue.Mock };

Assert.NotNull(mock.Object.GetEnumerable());
Assert.Equal(0, mock.Object.GetEnumerable().Count());
Assert.Empty(mock.Object.GetEnumerable());
}

[Fact]
Expand All @@ -190,7 +190,7 @@ public void ReturnsEmptyEnumerableObjectsOnLooseWithMockDefaultValue()
var mock = new Mock<IFoo>(MockBehavior.Loose) { DefaultValue = DefaultValue.Mock };

Assert.NotNull(mock.Object.GetEnumerableObjects());
Assert.Equal(0, mock.Object.GetEnumerableObjects().Cast<object>().Count());
Assert.Empty(mock.Object.GetEnumerableObjects().Cast<object>());
}

[Fact]
Expand Down
6 changes: 0 additions & 6 deletions UnitTests/MockFixture.cs → Moq.Tests/MockFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -897,12 +897,6 @@ public void DistinguishesSameMethodsWithDifferentGenericArguments()
Assert.Equal(3, mock.Object.Generic<string>());
}

[Fact]
public void CanCreateMockOfInternalInterface()
{
Assert.NotNull(new Mock<ClassLibrary1.IFooInternal>().Object);
}

/// <summary>
/// Mostly testing that these casts compile, but also that there are no runtime failures.
/// </summary>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 10 additions & 12 deletions UnitTests/Moq.Tests.csproj → Moq.Tests/Moq.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net452;netcoreapp1.0</TargetFrameworks>
<TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
<AssemblyName>Moq.Tests</AssemblyName>
<AssemblyOriginatorKeyFile>../Moq.snk</AssemblyOriginatorKeyFile>
<DebugSymbols>True</DebugSymbols>
Expand All @@ -11,36 +11,34 @@
<SignAssembly>true</SignAssembly>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net452' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'net46' ">
<DefineConstants>$(DefineConstants);DESKTOP;FEATURE_CAS;FEATURE_CODEDOM;FEATURE_COM;FEATURE_SERIALIZATION</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<DefineConstants>$(DefineConstants);NETCORE</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Castle.Core" Version="4.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit" Version="2.3.0-beta3-build3705" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta3-build3705" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="xunit" Version="2.3.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0" />
<ProjectReference Include="..\Source\Moq.csproj" />
<ProjectReference Include="Library\ClassLibrary1\ClassLibrary1.csproj" />
<ProjectReference Include="Library\ClassLibrary2\ClassLibrary2.csproj" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0-beta3-build3705" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<PackageReference Include="System.Collections.Specialized" Version="4.3.0" />
<PackageReference Include="System.ComponentModel.Primitives" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.TraceSource" Version="4.3.0" />
<PackageReference Include="System.ServiceModel.Primitives" Version="4.3.0" />
</ItemGroup>

<ItemGroup>
<Compile Remove="Library\**\*.cs;Pex\**\*.cs;Properties\**\*.cs" />
<Compile Remove="Pex\**\*.cs;Properties\**\*.cs" />
</ItemGroup>

<ItemGroup>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3185,29 +3185,6 @@ private void SetupOperationStub<T>(Func<T, string> valueFunction)

#endregion

#region #273

public class _273
{
[Fact]
public void WhenMockingAnExternalInterface_ThenItWorks()
{
Assert.NotNull(new Mock<ClassLibrary1.IFoo>().Object);
Assert.NotNull(Mock.Of<ClassLibrary1.IFoo>());
Assert.NotNull(new Mock<ClassLibrary1.Foo>().Object);
Assert.NotNull(new Mock<ClassLibrary2.IBar>().Object);
Assert.NotNull(Mock.Of<ClassLibrary2.IBar>());
Assert.NotNull(new Mock<ClassLibrary2.Bar>().Object);
Assert.NotNull(new Mock<Baz>().Object);
}

public class Baz : ClassLibrary2.Bar
{
}
}

#endregion

#region #325

public class _325
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
119 changes: 0 additions & 119 deletions Moq.VisualBasicTests/Moq.VisualBasicTests.vbproj

This file was deleted.

13 changes: 0 additions & 13 deletions Moq.VisualBasicTests/My Project/Application.Designer.vb

This file was deleted.

10 changes: 0 additions & 10 deletions Moq.VisualBasicTests/My Project/Application.myapp

This file was deleted.

35 changes: 0 additions & 35 deletions Moq.VisualBasicTests/My Project/AssemblyInfo.vb

This file was deleted.

Loading

0 comments on commit bc40732

Please sign in to comment.