Browse Source

Added functional Tests for catalog and ordering

pull/49/merge
Unai 8 years ago
parent
commit
339ea43f49
13 changed files with 351 additions and 52 deletions
  1. +52
    -35
      eShopOnContainers.sln
  2. +2
    -1
      global.json
  3. +2
    -0
      src/Services/Catalog/Catalog.API/Properties/launchSettings.json
  4. +1
    -1
      src/Services/Catalog/Catalog.API/settings.json
  5. +22
    -7
      src/Services/Ordering/Ordering.API/Infrastructure/Filters/HttpGlobalExceptionFilter.cs
  6. +1
    -1
      src/Services/Ordering/Ordering.API/project.json
  7. +4
    -3
      test/Services/FunctionalTests/FunctionalTests.xproj
  8. +40
    -0
      test/Services/FunctionalTests/Services/Catalog/CatalogScenarioBase.cs
  9. +69
    -0
      test/Services/FunctionalTests/Services/Catalog/CatalogScenarios.cs
  10. +34
    -0
      test/Services/FunctionalTests/Services/Ordering/OrderingScenarioBase.cs
  11. +102
    -0
      test/Services/FunctionalTests/Services/Ordering/OrderingScenarios.cs
  12. +19
    -4
      test/Services/FunctionalTests/project.json
  13. +3
    -0
      test/Services/FunctionalTests/settings.json

+ 52
- 35
eShopOnContainers.sln View File

@ -36,8 +36,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A857AD10-4
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{EF0337F2-ED00-4643-89FD-EE10863F1870}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{EF0337F2-ED00-4643-89FD-EE10863F1870}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Ordering.Test", "test\Services\Ordering.Test\Ordering.Test.xproj", "{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "eShopOnContainers.WebMVC", "src\Web\WebMVC\eShopOnContainers.WebMVC.xproj", "{F0333D8E-0B27-42B7-B2C6-78F3657624E2}" Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "eShopOnContainers.WebMVC", "src\Web\WebMVC\eShopOnContainers.WebMVC.xproj", "{F0333D8E-0B27-42B7-B2C6-78F3657624E2}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.Core", "src\Mobile\eShopOnContainers\eShopOnContainers.Core\eShopOnContainers.Core.csproj", "{65116D1C-145B-4693-ABDA-F0FB6F425191}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.Core", "src\Mobile\eShopOnContainers\eShopOnContainers.Core\eShopOnContainers.Core.csproj", "{65116D1C-145B-4693-ABDA-F0FB6F425191}"
@ -63,10 +61,13 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.TestRunner.Windows", "src\Mobile\eShopOnContainers\eShopOnContainers.TestRunner.Windows\eShopOnContainers.TestRunner.Windows.csproj", "{02680C26-CA1D-4D9D-A7E3-D66AF5BE6F2F}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.TestRunner.Windows", "src\Mobile\eShopOnContainers\eShopOnContainers.TestRunner.Windows\eShopOnContainers.TestRunner.Windows.csproj", "{02680C26-CA1D-4D9D-A7E3-D66AF5BE6F2F}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.TestRunner.iOS", "src\Mobile\eShopOnContainers\eShopOnContainers.TestRunner.iOS\eShopOnContainers.TestRunner.iOS.csproj", "{B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.TestRunner.iOS", "src\Mobile\eShopOnContainers\eShopOnContainers.TestRunner.iOS\eShopOnContainers.TestRunner.iOS.csproj", "{B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Ordering.Application", "src\Services\Ordering\Ordering.Application\Ordering.Application.xproj", "{4193CAA3-A1C3-4818-A06F-A2D85FDE77E7}" Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Ordering.Application", "src\Services\Ordering\Ordering.Application\Ordering.Application.xproj", "{4193CAA3-A1C3-4818-A06F-A2D85FDE77E7}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Ordering.Infrastructure", "src\Services\Ordering\Ordering.Infrastructure\Ordering.Infrastructure.xproj", "{95F1F07C-4D92-4742-BD07-E5B805AAB651}" Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Ordering.Infrastructure", "src\Services\Ordering\Ordering.Infrastructure\Ordering.Infrastructure.xproj", "{95F1F07C-4D92-4742-BD07-E5B805AAB651}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "FunctionalTests", "test\Services\FunctionalTests\FunctionalTests.xproj", "{621E7211-58D0-45FD-9600-1CB490BD930E}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
@ -199,32 +200,6 @@ Global
{F5598DCB-6DDE-4661-AD9D-A55612DA7E76}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {F5598DCB-6DDE-4661-AD9D-A55612DA7E76}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{F5598DCB-6DDE-4661-AD9D-A55612DA7E76}.Release|x64.ActiveCfg = Release|Any CPU {F5598DCB-6DDE-4661-AD9D-A55612DA7E76}.Release|x64.ActiveCfg = Release|Any CPU
{F5598DCB-6DDE-4661-AD9D-A55612DA7E76}.Release|x86.ActiveCfg = Release|Any CPU {F5598DCB-6DDE-4661-AD9D-A55612DA7E76}.Release|x86.ActiveCfg = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.AppStore|ARM.ActiveCfg = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.AppStore|iPhone.ActiveCfg = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.AppStore|x64.ActiveCfg = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.AppStore|x86.ActiveCfg = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Debug|ARM.ActiveCfg = Debug|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Debug|x64.ActiveCfg = Debug|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Debug|x86.ActiveCfg = Debug|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Release|Any CPU.Build.0 = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Release|ARM.ActiveCfg = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Release|iPhone.ActiveCfg = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Release|x64.ActiveCfg = Release|Any CPU
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967}.Release|x86.ActiveCfg = Release|Any CPU
{F0333D8E-0B27-42B7-B2C6-78F3657624E2}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU {F0333D8E-0B27-42B7-B2C6-78F3657624E2}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
{F0333D8E-0B27-42B7-B2C6-78F3657624E2}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU {F0333D8E-0B27-42B7-B2C6-78F3657624E2}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU
{F0333D8E-0B27-42B7-B2C6-78F3657624E2}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU {F0333D8E-0B27-42B7-B2C6-78F3657624E2}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
@ -513,7 +488,6 @@ Global
{9842DB3A-1391-48C7-A49C-2FABD0A18AC2}.Release|x64.Build.0 = Release|Any CPU {9842DB3A-1391-48C7-A49C-2FABD0A18AC2}.Release|x64.Build.0 = Release|Any CPU
{9842DB3A-1391-48C7-A49C-2FABD0A18AC2}.Release|x86.ActiveCfg = Release|Any CPU {9842DB3A-1391-48C7-A49C-2FABD0A18AC2}.Release|x86.ActiveCfg = Release|Any CPU
{9842DB3A-1391-48C7-A49C-2FABD0A18AC2}.Release|x86.Build.0 = Release|Any CPU {9842DB3A-1391-48C7-A49C-2FABD0A18AC2}.Release|x86.Build.0 = Release|Any CPU
<<<<<<< HEAD
{F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
{F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
{F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU {F7B6A162-BC4D-4924-B16A-713F9B0344E7}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU
@ -728,7 +702,6 @@ Global
{B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|x64.ActiveCfg = Release|iPhone {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|x64.ActiveCfg = Release|iPhone
{B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|x86.ActiveCfg = Release|iPhone {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3}.Release|x86.ActiveCfg = Release|iPhone
=======
{4193CAA3-A1C3-4818-A06F-A2D85FDE77E7}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU {4193CAA3-A1C3-4818-A06F-A2D85FDE77E7}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{4193CAA3-A1C3-4818-A06F-A2D85FDE77E7}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU {4193CAA3-A1C3-4818-A06F-A2D85FDE77E7}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{4193CAA3-A1C3-4818-A06F-A2D85FDE77E7}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU {4193CAA3-A1C3-4818-A06F-A2D85FDE77E7}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
@ -825,7 +798,54 @@ Global
{95F1F07C-4D92-4742-BD07-E5B805AAB651}.Release|x64.Build.0 = Release|Any CPU {95F1F07C-4D92-4742-BD07-E5B805AAB651}.Release|x64.Build.0 = Release|Any CPU
{95F1F07C-4D92-4742-BD07-E5B805AAB651}.Release|x86.ActiveCfg = Release|Any CPU {95F1F07C-4D92-4742-BD07-E5B805AAB651}.Release|x86.ActiveCfg = Release|Any CPU
{95F1F07C-4D92-4742-BD07-E5B805AAB651}.Release|x86.Build.0 = Release|Any CPU {95F1F07C-4D92-4742-BD07-E5B805AAB651}.Release|x86.Build.0 = Release|Any CPU
>>>>>>> OrderingRefactoring
{621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|Any CPU.Build.0 = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|ARM.ActiveCfg = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|ARM.Build.0 = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|iPhone.Build.0 = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|x64.ActiveCfg = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|x64.Build.0 = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|x86.ActiveCfg = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|x86.Build.0 = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|ARM.ActiveCfg = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|ARM.Build.0 = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|iPhone.Build.0 = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|x64.ActiveCfg = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|x64.Build.0 = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|x86.ActiveCfg = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|x86.Build.0 = Debug|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Release|Any CPU.Build.0 = Release|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Release|ARM.ActiveCfg = Release|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Release|ARM.Build.0 = Release|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Release|iPhone.ActiveCfg = Release|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Release|iPhone.Build.0 = Release|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Release|x64.ActiveCfg = Release|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Release|x64.Build.0 = Release|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Release|x86.ActiveCfg = Release|Any CPU
{621E7211-58D0-45FD-9600-1CB490BD930E}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -842,7 +862,6 @@ Global
{231226CE-690B-4979-8870-9A79D80928E2} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B} {231226CE-690B-4979-8870-9A79D80928E2} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B}
{F5598DCB-6DDE-4661-AD9D-A55612DA7E76} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B} {F5598DCB-6DDE-4661-AD9D-A55612DA7E76} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B}
{EF0337F2-ED00-4643-89FD-EE10863F1870} = {A857AD10-40FF-4303-BEC2-FF1C58D5735E} {EF0337F2-ED00-4643-89FD-EE10863F1870} = {A857AD10-40FF-4303-BEC2-FF1C58D5735E}
{A0AFC432-3846-4B4E-BD8E-3C8C896F4967} = {EF0337F2-ED00-4643-89FD-EE10863F1870}
{F0333D8E-0B27-42B7-B2C6-78F3657624E2} = {E279BF0F-7F66-4F3A-A3AB-2CDA66C1CD04} {F0333D8E-0B27-42B7-B2C6-78F3657624E2} = {E279BF0F-7F66-4F3A-A3AB-2CDA66C1CD04}
{65116D1C-145B-4693-ABDA-F0FB6F425191} = {778289CA-31F7-4464-8C2A-612EE846F8A7} {65116D1C-145B-4693-ABDA-F0FB6F425191} = {778289CA-31F7-4464-8C2A-612EE846F8A7}
{62DBB163-9CA9-4818-B48B-13233DF37C24} = {9CC7814B-72A6-465B-A61C-57B512DEE303} {62DBB163-9CA9-4818-B48B-13233DF37C24} = {9CC7814B-72A6-465B-A61C-57B512DEE303}
@ -851,15 +870,13 @@ Global
{778289CA-31F7-4464-8C2A-612EE846F8A7} = {F61357CE-1CC2-410E-8776-B16EEBC98EB8} {778289CA-31F7-4464-8C2A-612EE846F8A7} = {F61357CE-1CC2-410E-8776-B16EEBC98EB8}
{9CC7814B-72A6-465B-A61C-57B512DEE303} = {F61357CE-1CC2-410E-8776-B16EEBC98EB8} {9CC7814B-72A6-465B-A61C-57B512DEE303} = {F61357CE-1CC2-410E-8776-B16EEBC98EB8}
{9842DB3A-1391-48C7-A49C-2FABD0A18AC2} = {E279BF0F-7F66-4F3A-A3AB-2CDA66C1CD04} {9842DB3A-1391-48C7-A49C-2FABD0A18AC2} = {E279BF0F-7F66-4F3A-A3AB-2CDA66C1CD04}
<<<<<<< HEAD
{B7B1D395-4E06-4036-BE86-C216756B9367} = {A857AD10-40FF-4303-BEC2-FF1C58D5735E} {B7B1D395-4E06-4036-BE86-C216756B9367} = {A857AD10-40FF-4303-BEC2-FF1C58D5735E}
{F7B6A162-BC4D-4924-B16A-713F9B0344E7} = {B7B1D395-4E06-4036-BE86-C216756B9367} {F7B6A162-BC4D-4924-B16A-713F9B0344E7} = {B7B1D395-4E06-4036-BE86-C216756B9367}
{A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1} = {B7B1D395-4E06-4036-BE86-C216756B9367} {A289A7F0-ACD8-42AE-87B6-AB1AFD310BF1} = {B7B1D395-4E06-4036-BE86-C216756B9367}
{02680C26-CA1D-4D9D-A7E3-D66AF5BE6F2F} = {B7B1D395-4E06-4036-BE86-C216756B9367} {02680C26-CA1D-4D9D-A7E3-D66AF5BE6F2F} = {B7B1D395-4E06-4036-BE86-C216756B9367}
{B68C2B56-7581-46AE-B55D-D25DDFD3BFE3} = {B7B1D395-4E06-4036-BE86-C216756B9367} {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3} = {B7B1D395-4E06-4036-BE86-C216756B9367}
=======
{4193CAA3-A1C3-4818-A06F-A2D85FDE77E7} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B} {4193CAA3-A1C3-4818-A06F-A2D85FDE77E7} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B}
{95F1F07C-4D92-4742-BD07-E5B805AAB651} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B} {95F1F07C-4D92-4742-BD07-E5B805AAB651} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B}
>>>>>>> OrderingRefactoring
{621E7211-58D0-45FD-9600-1CB490BD930E} = {EF0337F2-ED00-4643-89FD-EE10863F1870}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

+ 2
- 1
global.json View File

@ -3,7 +3,8 @@
"src", "src",
"test", "test",
"src/Services/Ordering", "src/Services/Ordering",
"src/Web"
"src/Web",
"src/Services/Catalog"
], ],
"sdk": { "sdk": {


+ 2
- 0
src/Services/Catalog/Catalog.API/Properties/launchSettings.json View File

@ -10,6 +10,8 @@
"profiles": { "profiles": {
"IIS Express": { "IIS Express": {
"commandName": "IISExpress", "commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "/swagger/ui",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
} }


+ 1
- 1
src/Services/Catalog/Catalog.API/settings.json View File

@ -1,5 +1,5 @@
{ {
"ConnectionString": "Server=tcp:127.0.0.1,1433;Initial Catalog=CatalogDB;User Id=sa;Password=Pass@word",
"ConnectionString": "Server=tcp:127.0.0.1,5433;Initial Catalog=CatalogDB;User Id=sa;Password=Pass@word",
"Logging": { "Logging": {
"IncludeScopes": false, "IncludeScopes": false,
"LogLevel": { "LogLevel": {


+ 22
- 7
src/Services/Ordering/Ordering.API/Infrastructure/Filters/HttpGlobalExceptionFilter.cs View File

@ -1,9 +1,11 @@
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Filters namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Filters
{ {
using AspNetCore.Mvc;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.ActionResults; using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.ActionResults;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using System;
public class HttpGlobalExceptionFilter : IExceptionFilter public class HttpGlobalExceptionFilter : IExceptionFilter
{ {
@ -22,17 +24,30 @@
context.Exception, context.Exception,
context.Exception.Message); context.Exception.Message);
var json = new JsonErrorResponse
if (context.Exception.GetType() == typeof(ArgumentException)) //TODO:Select a common exception for application like EshopException
{ {
Messages = new[] { "An error ocurr.Try it again." }
};
var json = new JsonErrorResponse
{
Messages = new[] { context.Exception.Message }
};
if (env.IsDevelopment())
{
json.DeveloperMeesage = context.Exception;
context.Result = new BadRequestObjectResult(json);
} }
else
{
var json = new JsonErrorResponse
{
Messages = new[] { "An error ocurr.Try it again." }
};
context.Result = new InternalServerErrorObjectResult(json);
if (env.IsDevelopment())
{
json.DeveloperMeesage = context.Exception;
}
context.Result = new InternalServerErrorObjectResult(json);
}
} }
private class JsonErrorResponse private class JsonErrorResponse


+ 1
- 1
src/Services/Ordering/Ordering.API/project.json View File

@ -56,7 +56,7 @@
"wwwroot", "wwwroot",
"Views", "Views",
"Areas/**/Views", "Areas/**/Views",
"appsettings.json",
"settings.json",
"web.config", "web.config",
"docker-compose.yml", "docker-compose.yml",
"docker-compose.debug.yml", "docker-compose.debug.yml",


+ 4
- 3
test/Services/FunctionalTests/FunctionalTests.xproj View File

@ -4,7 +4,6 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" /> <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>621e7211-58d0-45fd-9600-1cb490bd930e</ProjectGuid> <ProjectGuid>621e7211-58d0-45fd-9600-1cb490bd930e</ProjectGuid>
@ -13,9 +12,11 @@
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath> <OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" /> <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
</Project>

+ 40
- 0
test/Services/FunctionalTests/Services/Catalog/CatalogScenarioBase.cs View File

@ -0,0 +1,40 @@

namespace FunctionalTests.Services.Catalog
{
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost;
using Microsoft.eShopOnContainers.Services.Catalog.API;
using System.IO;
public class CatalogScenarioBase
{
public TestServer CreateServer()
{
var webHostBuilder = new WebHostBuilder();
webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory());
webHostBuilder.UseStartup<Startup>();
return new TestServer(webHostBuilder);
}
public static class Get
{
public static string Items = "api/v1/catalog/items";
public static string Types = "api/v1/catalog/catalogtypes";
public static string Brands = "api/v1/catalog/catalogbrands";
public static string Paginated(int pageIndex, int pageCount)
{
return $"api/v1/catalog/items?pageIndex={pageIndex}&pageSize={pageCount}";
}
public static string Filtered(int catalogTypeId,int catalogBrandId)
{
return $"api/v1/catalog/items/type/{catalogTypeId}/brand/{catalogBrandId}";
}
}
}
}

+ 69
- 0
test/Services/FunctionalTests/Services/Catalog/CatalogScenarios.cs View File

@ -0,0 +1,69 @@
namespace FunctionalTests.Services.Catalog
{
using System.Threading.Tasks;
using Xunit;
public class CatalogScenarios
:CatalogScenarioBase
{
[Fact]
public async Task Get_get_all_catalogitems_and_response_ok_status_code()
{
using (var server = CreateServer())
{
var response = await server.CreateClient()
.GetAsync(Get.Items);
response.EnsureSuccessStatusCode();
}
}
[Fact]
public async Task Get_get_paginated_catalog_items_and_response_ok_status_code()
{
using (var server = CreateServer())
{
var response = await server.CreateClient()
.GetAsync(Get.Paginated(0,4));
response.EnsureSuccessStatusCode();
}
}
[Fact]
public async Task Get_get_filtered_catalog_items_and_response_ok_status_code()
{
using (var server = CreateServer())
{
var response = await server.CreateClient()
.GetAsync(Get.Filtered(1, 1));
response.EnsureSuccessStatusCode();
}
}
[Fact]
public async Task Get_catalog_types_response_ok_status_code()
{
using (var server = CreateServer())
{
var response = await server.CreateClient()
.GetAsync(Get.Types);
response.EnsureSuccessStatusCode();
}
}
[Fact]
public async Task Get_catalog_brands_response_ok_status_code()
{
using (var server = CreateServer())
{
var response = await server.CreateClient()
.GetAsync(Get.Brands);
response.EnsureSuccessStatusCode();
}
}
}
}

+ 34
- 0
test/Services/FunctionalTests/Services/Ordering/OrderingScenarioBase.cs View File

@ -0,0 +1,34 @@
namespace FunctionalTests.Services.Ordering
{
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost;
using Microsoft.eShopOnContainers.Services.Ordering.API;
using System.IO;
public class OrderingScenarioBase
{
public TestServer CreateServer()
{
var webHostBuilder = new WebHostBuilder();
webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory());
webHostBuilder.UseStartup<Startup>();
return new TestServer(webHostBuilder);
}
public static class Get
{
public static string Orders = "api/v1/orders";
public static string OrderBy(int id)
{
return $"api/v1/orders/{id}";
}
}
public static class Post
{
public static string AddNewOrder = "api/v1/orders/new";
}
}
}

+ 102
- 0
test/Services/FunctionalTests/Services/Ordering/OrderingScenarios.cs View File

@ -0,0 +1,102 @@
namespace FunctionalTests.Services.Ordering
{
using Microsoft.AspNetCore.TestHost;
using Microsoft.eShopOnContainers.Services.Ordering.API.Models;
using Microsoft.eShopOnContainers.Services.Ordering.Domain;
using Newtonsoft.Json;
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Xunit;
public class OrderingScenarios
: OrderingScenarioBase
{
[Fact]
public async Task Get_get_all_stored_orders_and_response_ok_status_code()
{
using (var server = CreateServer())
{
var response = await server.CreateClient()
.GetAsync(Get.Orders);
response.EnsureSuccessStatusCode();
}
}
[Fact]
public async Task Get_get_order_and_response_ok_status_code()
{
using (var server = CreateServer())
{
var response = await server.CreateClient()
.GetAsync(Get.OrderBy(31));
response.EnsureSuccessStatusCode();
}
}
[Fact]
public async Task AddNewOrder_add_new_order_and_response_ok_status_code()
{
using (var server = CreateServer())
{
var content = new StringContent(BuildOrder(), UTF8Encoding.UTF8, "application/json");
var response = await server.CreateClient()
.PostAsync(Post.AddNewOrder, content);
response.EnsureSuccessStatusCode();
}
}
[Fact]
public async Task AddNewOrder_response_bad_request_if_card_expiration_is_invalid()
{
using (var server = CreateServer())
{
var content = new StringContent(BuildOrderWithInvalidExperationTime(), UTF8Encoding.UTF8, "application/json");
var response = await server.CreateClient()
.PostAsync(Post.AddNewOrder,content);
Assert.True(response.StatusCode == System.Net.HttpStatusCode.BadRequest);
}
}
string BuildOrder()
{
var order = new NewOrderViewModel()
{
CardExpiration = DateTime.UtcNow.AddYears(1),
CardNumber = "5145-555-5555",
CardHolderName = "Jhon Senna",
CardSecurityNumber = "232",
CardType = "Amex",
ShippingCity = "Redmon",
ShippingCountry = "USA",
ShippingState = "WA",
ShippingStreet = "One way"
};
return JsonConvert.SerializeObject(order);
}
string BuildOrderWithInvalidExperationTime()
{
var order = new NewOrderViewModel()
{
CardExpiration = DateTime.UtcNow.AddYears(-1),
CardNumber = "5145-555-5555",
CardHolderName = "Jhon Senna",
CardSecurityNumber = "232",
CardType = "Amex",
ShippingCity = "Redmon",
ShippingCountry = "USA",
ShippingState = "WA",
ShippingStreet = "One way"
};
return JsonConvert.SerializeObject(order);
}
}
}

+ 19
- 4
test/Services/FunctionalTests/project.json View File

@ -2,12 +2,27 @@
"version": "1.0.0-*", "version": "1.0.0-*",
"dependencies": { "dependencies": {
"NETStandard.Library": "1.6.0"
"xunit": "2.2.0-beta2-build3300",
"Ordering.API": "1.0.0-*",
"Microsoft.AspNetCore.TestHost": "1.1.0",
"dotnet-test-xunit": "2.2.0-preview2-build1029",
"Catalog.API": "1.0.0-*"
}, },
"testRunner": "xunit",
"frameworks": { "frameworks": {
"netstandard1.6": {
"imports": "dnxcore50"
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.1"
}
}
} }
},
"publishOptions": {
"include": [
"settings.json",
"web.config"
]
} }
} }

+ 3
- 0
test/Services/FunctionalTests/settings.json View File

@ -0,0 +1,3 @@
{
"ConnectionString": "Server=tcp:127.0.0.1,5433;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word;"
}

Loading…
Cancel
Save