Skip to content

Commit

Permalink
Merge pull request #95 from Tynamix/Refactor_Project_to_VS_2017
Browse files Browse the repository at this point in the history
Refactor project to vs 2017
  • Loading branch information
Tynamix authored Feb 13, 2017
2 parents 8cce369 + d2dadd3 commit 9269810
Show file tree
Hide file tree
Showing 45 changed files with 1,113 additions and 6,384 deletions.
39 changes: 28 additions & 11 deletions ObjectFillerNET.sln
Original file line number Diff line number Diff line change
@@ -1,31 +1,48 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.26206.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0EC5FD26-A565-4D47-A192-0FC142C3B7F0}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Tynamix.ObjectFiller", "Tynamix.ObjectFiller\Tynamix.ObjectFiller.xproj", "{3208D63E-1A26-453C-8A31-03491CD23780}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tynamix.ObjectFiller", "Tynamix.ObjectFiller\Tynamix.ObjectFiller.csproj", "{3208D63E-1A26-453C-8A31-03491CD23780}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Tynamix.ObjectFiller.Test", "Tynamix.ObjectFiller.Test\Tynamix.ObjectFiller.Test.xproj", "{F679FAB4-CE29-48F8-B87C-3C89CDAF0D85}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tynamix.Objectfiller.Test", "Tynamix.Objectfiller.Test\Tynamix.Objectfiller.Test.csproj", "{76592E58-909C-4AE7-9FE4-6AD415AE1D80}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3208D63E-1A26-453C-8A31-03491CD23780}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3208D63E-1A26-453C-8A31-03491CD23780}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3208D63E-1A26-453C-8A31-03491CD23780}.Debug|x64.ActiveCfg = Debug|x64
{3208D63E-1A26-453C-8A31-03491CD23780}.Debug|x64.Build.0 = Debug|x64
{3208D63E-1A26-453C-8A31-03491CD23780}.Debug|x86.ActiveCfg = Debug|x86
{3208D63E-1A26-453C-8A31-03491CD23780}.Debug|x86.Build.0 = Debug|x86
{3208D63E-1A26-453C-8A31-03491CD23780}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3208D63E-1A26-453C-8A31-03491CD23780}.Release|Any CPU.Build.0 = Release|Any CPU
{F679FAB4-CE29-48F8-B87C-3C89CDAF0D85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F679FAB4-CE29-48F8-B87C-3C89CDAF0D85}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F679FAB4-CE29-48F8-B87C-3C89CDAF0D85}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F679FAB4-CE29-48F8-B87C-3C89CDAF0D85}.Release|Any CPU.Build.0 = Release|Any CPU
{3208D63E-1A26-453C-8A31-03491CD23780}.Release|x64.ActiveCfg = Release|x64
{3208D63E-1A26-453C-8A31-03491CD23780}.Release|x64.Build.0 = Release|x64
{3208D63E-1A26-453C-8A31-03491CD23780}.Release|x86.ActiveCfg = Release|x86
{3208D63E-1A26-453C-8A31-03491CD23780}.Release|x86.Build.0 = Release|x86
{76592E58-909C-4AE7-9FE4-6AD415AE1D80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{76592E58-909C-4AE7-9FE4-6AD415AE1D80}.Debug|Any CPU.Build.0 = Debug|Any CPU
{76592E58-909C-4AE7-9FE4-6AD415AE1D80}.Debug|x64.ActiveCfg = Debug|Any CPU
{76592E58-909C-4AE7-9FE4-6AD415AE1D80}.Debug|x64.Build.0 = Debug|Any CPU
{76592E58-909C-4AE7-9FE4-6AD415AE1D80}.Debug|x86.ActiveCfg = Debug|Any CPU
{76592E58-909C-4AE7-9FE4-6AD415AE1D80}.Debug|x86.Build.0 = Debug|Any CPU
{76592E58-909C-4AE7-9FE4-6AD415AE1D80}.Release|Any CPU.ActiveCfg = Release|Any CPU
{76592E58-909C-4AE7-9FE4-6AD415AE1D80}.Release|Any CPU.Build.0 = Release|Any CPU
{76592E58-909C-4AE7-9FE4-6AD415AE1D80}.Release|x64.ActiveCfg = Release|Any CPU
{76592E58-909C-4AE7-9FE4-6AD415AE1D80}.Release|x64.Build.0 = Release|Any CPU
{76592E58-909C-4AE7-9FE4-6AD415AE1D80}.Release|x86.ActiveCfg = Release|Any CPU
{76592E58-909C-4AE7-9FE4-6AD415AE1D80}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
82 changes: 41 additions & 41 deletions Tynamix.ObjectFiller.Test/AddressFillingTest.cs
Original file line number Diff line number Diff line change
@@ -1,88 +1,88 @@
using Xunit;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ObjectFiller.Test.TestPoco.Person;
using Tynamix.ObjectFiller;

namespace ObjectFiller.Test
{
using System.Linq;


[TestClass]
public class AddressFillingTest
{
[Fact]
[TestMethod]
public void FillAllAddressProperties()
{
Filler<Address> addressFiller = new Filler<Address>();
Address a = addressFiller.Create();
Address a = addressFiller.Create();

Assert.NotNull(a.City);
Assert.NotNull(a.Country);
Assert.NotEqual(0, a.HouseNumber);
Assert.NotNull(a.PostalCode);
Assert.NotNull(a.Street);
Assert.IsNotNull(a.City);
Assert.IsNotNull(a.Country);
Assert.AreNotEqual(0, a.HouseNumber);
Assert.IsNotNull(a.PostalCode);
Assert.IsNotNull(a.Street);
}

[Fact]
[TestMethod]
public void IgnoreCountry()
{
Filler<Address> addressFiller = new Filler<Address>();
addressFiller.Setup()
.OnProperty(x => x.Country).IgnoreIt();
Address a = addressFiller.Create();

Assert.NotNull(a.City);
Assert.Null(a.Country);
Assert.NotEqual(0, a.HouseNumber);
Assert.NotNull(a.PostalCode);
Assert.NotNull(a.Street);
Assert.IsNotNull(a.City);
Assert.IsNull(a.Country);
Assert.AreNotEqual(0, a.HouseNumber);
Assert.IsNotNull(a.PostalCode);
Assert.IsNotNull(a.Street);
}

[Fact]
[TestMethod]
public void IgnoreCountryAndCity()
{
Filler<Address> addressFiller = new Filler<Address>();
addressFiller.Setup()
.OnProperty(x => x.Country, x => x.City).IgnoreIt();
Address a = addressFiller.Create();

Assert.Null(a.City);
Assert.Null(a.Country);
Assert.NotEqual(0, a.HouseNumber);
Assert.NotNull(a.PostalCode);
Assert.NotNull(a.Street);
Assert.IsNull(a.City);
Assert.IsNull(a.Country);
Assert.AreNotEqual(0, a.HouseNumber);
Assert.IsNotNull(a.PostalCode);
Assert.IsNotNull(a.Street);
}

[Fact]
[TestMethod]
public void SetupCityPropertyWithConstantValue()
{
Filler<Address> addressFiller = new Filler<Address>();
addressFiller.Setup()
.OnProperty(ad => ad.City).Use(() => "City");
Address a = addressFiller.Create();

Assert.Equal("City", a.City);
Assert.NotNull(a.Country);
Assert.NotEqual(0, a.HouseNumber);
Assert.NotNull(a.PostalCode);
Assert.NotNull(a.Street);
Assert.AreEqual("City", a.City);
Assert.IsNotNull(a.Country);
Assert.AreNotEqual(0, a.HouseNumber);
Assert.IsNotNull(a.PostalCode);
Assert.IsNotNull(a.Street);
}

[Fact]
[TestMethod]
public void SetupCityAndCountryPropertyWithConstantValue()
{
Filler<Address> addressFiller = new Filler<Address>();
addressFiller.Setup()
.OnProperty(ad => ad.City, ad => ad.Country).Use(() => "CityCountry");
Address a = addressFiller.Create();

Assert.Equal("CityCountry", a.City);
Assert.NotNull(a.Country);
Assert.NotEqual(0, a.HouseNumber);
Assert.NotNull(a.PostalCode);
Assert.NotNull(a.Street);
Assert.AreEqual("CityCountry", a.City);
Assert.IsNotNull(a.Country);
Assert.AreNotEqual(0, a.HouseNumber);
Assert.IsNotNull(a.PostalCode);
Assert.IsNotNull(a.Street);
}

[Fact]
[TestMethod]
public void SetupTheAdressWithStaticValues()
{
Filler<Address> addressFiller = new Filler<Address>();
Expand All @@ -93,13 +93,13 @@ public void SetupTheAdressWithStaticValues()
.OnProperty(x => x.PostalCode).Use(() => "0011100");

var address = addressFiller.Create();
Assert.Equal("Dresden", address.City);
Assert.Equal("Germany", address.Country);
Assert.Equal("0011100", address.PostalCode);
Assert.Equal(10, address.HouseNumber);
Assert.AreEqual("Dresden", address.City);
Assert.AreEqual("Germany", address.Country);
Assert.AreEqual("0011100", address.PostalCode);
Assert.AreEqual(10, address.HouseNumber);
}

[Fact]
[TestMethod]
public void RandomListPluginShallReturnDifferentValues()
{
Filler<Address> addressFiller = new Filler<Address>();
Expand All @@ -108,15 +108,15 @@ public void RandomListPluginShallReturnDifferentValues()

var addresses = addressFiller.Create(1000);

Assert.True(addresses.Any(x => x.City == "Test2"));
Assert.IsTrue(addresses.Any(x => x.City == "Test2"));

addressFiller = new Filler<Address>();

addressFiller.Setup().OnProperty(x => x.City).Use(new RandomListItem<string>("Test1"));

addresses = addressFiller.Create(1000);

Assert.True(addresses.All(x => x.City == "Test1"));
Assert.IsTrue(addresses.All(x => x.City == "Test1"));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,25 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace ObjectFiller.Test.BugfixTests
{
using Tynamix.ObjectFiller;

using Xunit;


public class Bug68HashsetCanNotBeCreated
{
[Fact]
[TestMethod]
public void AHashsetShouldBeGenerated()
{
Filler<HashSet<string>> filler = new Filler<HashSet<string>>();

var hashset = filler.Create();

Assert.NotNull(hashset);
Assert.True(hashset.Any());
Assert.IsNotNull(hashset);
Assert.IsTrue(hashset.Any());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace ObjectFiller.Test.BugfixTests
{
using Tynamix.ObjectFiller;

using Xunit;


public class Bug87ErrorWhenNameInParentIsSameAsParent
{
Expand All @@ -24,15 +25,15 @@ public class Child
public string MakeTheError { get; set; }
}

[Fact]
[TestMethod]
public void ParentShallGetFilledWithourError()
{
Filler<Parent> filler = new Filler<Parent>();

var filledObject = filler.Create();
Assert.NotNull(filledObject);
Assert.NotNull(filledObject.MakeTheError);
Assert.False(string.IsNullOrWhiteSpace(filledObject.Child.MakeTheError));
Assert.IsNotNull(filledObject);
Assert.IsNotNull(filledObject.MakeTheError);
Assert.IsFalse(string.IsNullOrWhiteSpace(filledObject.Child.MakeTheError));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace ObjectFiller.Test.BugfixTests
{
using Tynamix.ObjectFiller;

using Xunit;



public class Bug89FillTypesInheritsFromDictionary
Expand All @@ -28,16 +29,16 @@ public class EntityBList : Dictionary<string, EntityB>
public DateTime SomeDate { get; set; }
}

[Fact]
[TestMethod]
public void ADerivedDictionaryShallGetFilledAllProperties()
{
Filler<EntityA> filler = new Filler<EntityA>();

var result = filler.Create();

Assert.NotNull(result.Bs);
Assert.InRange(result.Bs.SomeDate, DateTime.MinValue.AddSeconds(1), DateTime.MaxValue.AddSeconds(-1));
Assert.True(result.Bs.Any());
Assert.IsNotNull(result.Bs);
Assert.IsTrue(result.Bs.SomeDate > DateTime.MinValue.AddSeconds(1) && result.Bs.SomeDate < DateTime.MaxValue.AddSeconds(-1));
Assert.IsTrue(result.Bs.Any());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace ObjectFiller.Test.BugfixTests
{
using Tynamix.ObjectFiller;

using Xunit;



public class Bug89FillTypesInheritsFromList
Expand All @@ -28,16 +29,16 @@ public class EntityBList : List<EntityB>
public DateTime SomeDate { get; set; }
}

[Fact]
[TestMethod]
public void ADerivedListShallGetFilledAllProperties()
{
Filler<EntityA> filler = new Filler<EntityA>();

var result = filler.Create();

Assert.NotNull(result.Bs);
Assert.InRange(result.Bs.SomeDate, DateTime.MinValue.AddSeconds(1), DateTime.MaxValue.AddSeconds(-1));
Assert.True(result.Bs.Any());
Assert.IsNotNull(result.Bs);
Assert.IsTrue(result.Bs.SomeDate > DateTime.MinValue.AddSeconds(1) && result.Bs.SomeDate < DateTime.MaxValue.AddSeconds(-1));
Assert.IsTrue(result.Bs.Any());
}
}
}
10 changes: 6 additions & 4 deletions Tynamix.ObjectFiller.Test/CityNamesPluginTest.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace ObjectFiller.Test
{
using Xunit;


using Tynamix.ObjectFiller;


[TestClass]
public class CityNamesPluginTest
{
[Fact]
[TestMethod]
public void RandomNameIsReturned()
{
var sut = new CityName();
var value = sut.GetValue();

Assert.False(string.IsNullOrEmpty(value));
Assert.IsFalse(string.IsNullOrEmpty(value));
}
}
}
Loading

0 comments on commit 9269810

Please sign in to comment.