Skip to content

Commit

Permalink
AppVeyor integration
Browse files Browse the repository at this point in the history
  • Loading branch information
umutozel committed Jun 1, 2017
1 parent 0951f93 commit fd1a1a0
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,4 @@ paket-files/
/BatMap/.scannerwork
/.scannerwork
/opencoverCoverage.xml
/tools
5 changes: 4 additions & 1 deletion Giver.Tests/ComplexTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ public void With_Order() {

[Fact]
public void With_Company() {
TestModel testModel = _give.Me<TestModel>().With(tm => tm.CompanyField = _give.Me<Company>());
TestModel testModel = _give.Me<TestModel>()
.With(tm => tm.CompanyField = _give.Me<Company>())
.With(tm => tm.OrdersProp = _give.Many<Order>(0));

Assert.NotNull(testModel.CompanyField);
Assert.True(testModel.OrdersProp != null && testModel.OrdersProp.Count == 0);
}

[Fact]
Expand Down
4 changes: 1 addition & 3 deletions Giver.Tests/Giver.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net45</TargetFrameworks>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.extensibility.execution" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="coveralls.net" Version="0.7.0" />
<PackageReference Include="OpenCover" Version="4.6.519" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Giver.Tests/SimpleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void Instance_Api_Single_Convert() {

[Fact]
public void Instance_Api_Multi() {
var give = new Give();
var give = new Give(Enumerable.Empty<IValueGenerator>());
var testModels = give.Many<TestModel>(5);

Assert.Equal(testModels.Count, 5);
Expand Down
23 changes: 23 additions & 0 deletions Giver/Giver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,33 @@

<PropertyGroup>
<TargetFrameworks>netstandard1.0;net45</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Version>0.1</Version>
<Authors>Umut Özel</Authors>
<summary>Generate gibberish filled objects</summary>
<Description>Generate gibberish filled objects

Give&lt;Customer&gt;.ToMe()
give.Me&lt;Customer&gt;().With(c =&gt; c.Address = give.Me&lt;Address&gt;())</Description>
<Company></Company>
<NeutralLanguage>en</NeutralLanguage>
<Copyright>Copyright (c) 2017</Copyright>
<PackageLicenseUrl>https://github.com/umutozel/Giver/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/umutozel/Giver</PackageProjectUrl>
<RepositoryUrl>https://github.com/umutozel/Giver</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>Unit Test Object Generate Give</PackageTags>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<PackageIconUrl>https://image.ibb.co/nyxz8F/logo.png</PackageIconUrl>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.0'">
<DefineConstants>NET_STANDARD</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard1.0|AnyCPU'">
<DebugType>full</DebugType>
<DebugSymbols>True</DebugSymbols>
</PropertyGroup>

</Project>
13 changes: 9 additions & 4 deletions Giver/Giver.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
<metadata>
<id>Giver</id>
<version>0.1</version>
<title>Giver: generate gibberish filled objects</title>
<title>Generate gibberish filled objects</title>
<authors>Umut Özel</authors>
<owners>Umut Özel</owners>
<licenseUrl>https://github.com/umutozel/Giver/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/umutozel/Giver</projectUrl>
<iconUrl>https://image.ibb.co/itRs6Q/logo.png</iconUrl>
<iconUrl>https://image.ibb.co/nyxz8F/logo.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Give&lt;Customer&gt;.Now()</description>
<summary>give.Me&lt;Customer&gt;().With(c => c.Address = give.Me&lt;Address&gt;()).</summary>
<Description>
Generate gibberish filled objects

Give&lt;Customer&gt;.ToMe()
give.Me&lt;Customer&gt;().With(c =&gt; c.Address = give.Me&lt;Address&gt;())
</Description>
<summary>Generate gibberish filled objects</summary>
<copyright>Copyright (c) 2017</copyright>
<language>en-US</language>
<tags>Unit Test Object Generate Give</tags>
Expand Down
4 changes: 1 addition & 3 deletions Giver/ValueGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ public virtual bool CanGenerate(Type memberType, MemberInfo memberInfo) {
return typeof(T) == memberType;
}

public virtual T GetValue(MemberInfo memberInfo) {
return default(T);
}
public abstract T GetValue(MemberInfo memberInfo);

object IValueGenerator.GetValue(MemberInfo memberInfo) {
return GetValue(memberInfo);
Expand Down
38 changes: 38 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
version: 0.1.{build}

image: Visual Studio 2017

configuration: Release

assembly_info:
patch: true
file: '**\AssemblyInfo.*'
assembly_version: '{version}'
assembly_file_version: '{version}'
assembly_informational_version: '{version}'

build:
project: .\Giver.sln
verbosity: minimal

before_build:
- nuget restore

after_build:
- dotnet pack Giver\Giver.csproj -c:%CONFIGURATION% /p:Version=%appveyor_build_version%
- appveyor PushArtifact Giver\bin\%CONFIGURATION%\BatMap.%appveyor_build_version%.nupkg

test_script:
- nuget install OpenCover -Version 4.6.519 -OutputDirectory tools
- nuget install coveralls.net -Version 0.7.0 -OutputDirectory tools
- .\tools\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"C:\Program Files\dotnet\dotnet.exe" -targetargs:"test Giver.Tests\Giver.csproj" -register:user -filter:"+[Giver*]*" -excludebyattribute:*.ExcludeFromCodeCoverage* -returntargetcode -output:opencoverCoverage.xml
- .\tools\coveralls.net.0.7.0\tools\csmacnz.Coveralls.exe --opencover -i opencoverCoverage.xml --repoToken "%COVERALLS_REPO_TOKEN%" --useRelativePaths --commitId "%APPVEYOR_REPO_COMMIT%" --commitBranch "%APPVEYOR_REPO_BRANCH%" --commitAuthor "%APPVEYOR_REPO_COMMIT_AUTHOR%" --commitEmail "%APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL%" --commitMessage "%APPVEYOR_REPO_COMMIT_MESSAGE%" --jobId "%APPVEYOR_BUILD_NUMBER%" --serviceName appveyor

deploy:
provider: NuGet
api_key:
secure: hQY0HMU8ADJvqFfivG/Z0+h2Nz8xFCFd64ERHhaTFc3SzRy3Kz8C3FE8tiJMqMjz
skip_symbols: false
artifact: /.*\.nupkg/
on:
appveyor_repo_tag: true
Binary file added logo.ico
Binary file not shown.
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fd1a1a0

Please sign in to comment.