diff --git a/UnitTests/DomainObjects/ComplexDomainObject.cs b/UnitTests/DomainObjects/ComplexDomainObject.cs index 5ad4c91..bfd3823 100644 --- a/UnitTests/DomainObjects/ComplexDomainObject.cs +++ b/UnitTests/DomainObjects/ComplexDomainObject.cs @@ -19,4 +19,6 @@ public void CustomMap(IMapperConfigurationExpression configuration) .ForMember(dest => dest.Age, opt => opt.MapFrom(src => src.Age)); } } + + } \ No newline at end of file diff --git a/UnitTests/MapperTests/ComplexDomainObjectTests.cs b/UnitTests/MapperTests/ComplexDomainObjectTests.cs index e69a1d7..6bad62e 100644 --- a/UnitTests/MapperTests/ComplexDomainObjectTests.cs +++ b/UnitTests/MapperTests/ComplexDomainObjectTests.cs @@ -1,21 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Text; -using AutoMapper; +using AutoMapper; using DomainObjects; using EntityObjects; using FizzWare.NBuilder; -using Threenine.Map; +using System; using Xunit; namespace MapperTests { - public class ComplexDomainObjectTests : IClassFixture, IDisposable + [Collection("Mapping")] + public class ComplexDomainObjectTests : IDisposable { - private readonly MapperFixture fixture; - public ComplexDomainObjectTests(MapperFixture fix) + private readonly MapperFixture _mapperFixture; + public ComplexDomainObjectTests(MapperFixture fixture) { - fixture = fix; + _mapperFixture = fixture; } [Fact] @@ -25,28 +23,17 @@ public void ShouldMapComplexObject() var testobj = Builder.CreateNew().Build(); var ent = Mapper.Map(testobj); + Assert.NotNull(ent); Assert.IsAssignableFrom(ent); Assert.Equal(ent.Name, string.Concat(testobj.Firstname, " ", testobj.LastName)); Assert.Equal(ent.Description, string.Concat(testobj.Title, " ", testobj.Summary)); } - [Fact] - public void ShouldMapSimpleObject() - { - - var testobj = Builder.CreateNew().Build(); - - var ent = Mapper.Map(testobj); - - Assert.NotNull(ent); - Assert.IsAssignableFrom(ent); - Assert.Equal(ent.Name, testobj.Name); - } - + public void Dispose() { - fixture?.Dispose(); + _mapperFixture?.Dispose(); } } } diff --git a/UnitTests/MapperTests/MapperFixture.cs b/UnitTests/MapperTests/MapperFixture.cs index 6139e0e..cc6ee46 100644 --- a/UnitTests/MapperTests/MapperFixture.cs +++ b/UnitTests/MapperTests/MapperFixture.cs @@ -11,7 +11,7 @@ public class MapperFixture : IDisposable { public MapperFixture() { - MapConfigurationFactory.Scan(); + MapConfigurationFactory.Scan(); } public void Dispose() diff --git a/UnitTests/MapperTests/SimpleDomainObjectTests.cs b/UnitTests/MapperTests/SimpleDomainObjectTests.cs new file mode 100644 index 0000000..09b458d --- /dev/null +++ b/UnitTests/MapperTests/SimpleDomainObjectTests.cs @@ -0,0 +1,38 @@ +using AutoMapper; +using DomainObjects; +using EntityObjects; +using FizzWare.NBuilder; +using System; +using Xunit; + +namespace MapperTests +{ + [Collection("Mapping")] + public class SimpleDomainObjectTests :IDisposable + { + private readonly MapperFixture _mapperFixture; + public SimpleDomainObjectTests(MapperFixture fixture) + { + _mapperFixture = fixture; + + } + + [Fact] + public void ShouldMapSimpleObject() + { + var testobj = Builder.CreateNew().Build(); + var ent = Mapper.Map(testobj); + + Assert.NotNull(ent); + Assert.IsAssignableFrom(ent); + Assert.Equal(ent.Name, testobj.Name); + } + + + + public void Dispose() + { + _mapperFixture?.Dispose(); + } + } +} diff --git a/UnitTests/MapperTests/TestCollection.cs b/UnitTests/MapperTests/TestCollection.cs new file mode 100644 index 0000000..97195c0 --- /dev/null +++ b/UnitTests/MapperTests/TestCollection.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Xunit; + +namespace MapperTests +{ + [CollectionDefinition("Mapping")] + public class TestCollection :ICollectionFixture + { + } +} diff --git a/new 1.txt b/new 1.txt new file mode 100644 index 0000000..1dc17e7 --- /dev/null +++ b/new 1.txt @@ -0,0 +1,20 @@ ++ InnerException {System.Exception: Call to Node module failed with error: Error: Cannot find module './wwwroot/dist/vendor-manifest.json' + at Function.Module._resolveFilename (module.js:469:15) + at Function.Module._load (module.js:417:25) + at Module.require (module.js:497:17) + at require (internal/module.js:20:19) + at module.exports (C:\code\prototype\SMS\webpack.config.js:36:27) + at createWebpackDevServer (C:\code\prototype\SMS\node_modules\aspnet-webpack\WebpackDevMiddleware.js:176:31) + at createWebpackDevServer (C:\Users\garyw\AppData\Local\Temp\tmp7A46.tmp:74:50) + at C:\Users\garyw\AppData\Local\Temp\tmp7B31.tmp:113:19 + at IncomingMessage. (C:\Users\garyw\AppData\Local\Temp\tmp7B31.tmp:132:38) + at emitNone (events.js:86:13) + at Microsoft.AspNetCore.NodeServices.HostingModels.HttpNodeInstance.d__7`1.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.NodeServices.HostingModels.OutOfProcessNodeInstance.d__14`1.MoveNext() +--- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.AspNetCore.NodeServices.NodeServicesImpl.d__10`1.MoveNext()} System.Exception