Commit Graph

35990 Commits

Author SHA1 Message Date
Bjarke Berg
cfaa353dff Fixed isses with NewEmpty* integration tests
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-28 14:54:16 +01:00
Bjarke Berg
8c5daec967 Clean in tests + Moved logviewer tests from integration to unit tests, and minimized the test file, to speed up the tests
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-28 09:41:23 +01:00
Bjarke Berg
765140b7cd Moved unit tests to right project + Cleanup + Write info in test console
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-27 14:10:19 +01:00
Bjarke Berg
a09e218501 Merge remote-tracking branch 'origin/netcore/bugfix/azure-devops-tests' into netcore/netcore 2020-10-27 12:01:44 +01:00
Bjarke Berg
d4376e00c6 removed test file
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-27 12:01:17 +01:00
Bjarke Berg
5d5c4c6904 Remove build warnings
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-27 12:00:30 +01:00
Bjarke Berg
1b4f3a9a5f Remove test file again
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-27 11:58:54 +01:00
Bjarke Berg
4d260b036b Merge branch 'netcore/bugfix/azure-devops-tests' into netcore/netcore 2020-10-27 11:57:38 +01:00
Bjarke Berg
6c2ece0619 Remove build warnings
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-27 11:57:15 +01:00
Paul Johnson
ec66990e72 NetCore: MSDI refactor phase 2 (#9280)
* Moved adapters from Infra -> Core

* Allow Composition to accept a service collection instead of an IRegister

* Composition no longer takes IRegister as constructor arg

all tests passing

* Composition no longer implements IRegister

* Lose _uniques in Composition

* lose Composition OnCreatingFactory actions

* Clean up UmbracoCoreServiceCollectionExtensions & Composition

Less IFactory

* LightInject gone where TFW == netstandard2.0 || TFW == netcoreapp3.1

* Resolve dead code issues

* Rename IFactory methods to match IServiceProvider so they can be trivially swapped later.

* Rename IFactory methods to match IServiceProvider so they can be trivially swapped later (continued)

Thought the counts were low, it's mostly extension method usage
2020-10-27 11:53:01 +01:00
Bjarke Berg
a6ef907427 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/bugfix/azure-devops-tests 2020-10-26 16:26:59 +01:00
Andy Butland
507facbdaa NetCore: Further unit test migration (#9269)
* Migrated ContentExtensionsTests.

* Migrated PropertyCollectionTests.

* Migrated AbstractFileSystemTests and PhysicalFileSystem tests.

* Migrated SiteDomainHelper tests.

* Migrated DistributedCacheTests.

* Migrated AppCacheTests and derived test classes.
Amended HttpRequestApp underlying dictionary type to match that available in .NET Core HttpContext Items collection.

* Fixed namespace

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2020-10-26 14:26:49 +01:00
Mole
9cd752c2f8 Netcore: Align Namespaces in Tests and Web.BackOffice (#9274)
* Align namespaces in integration tests

* Align namespaces in unit tests

* Align namespaces in Backoffice.Filters

* Align namespaces in Backoffice.ActionResults

* Align namespaces in Backoffice.Mapping

* Align namespaces in Backoffice.PorpertyEditors and SignalR

* Align namespaces in Backoffice.Trees

* Align unit tests after migration
2020-10-26 13:34:08 +01:00
Paul Johnson
a99f625f6a Netcore: Alternate approach for MSDI refactor (#9247)
* Doesn't make much sense to have Concrete on IRegister, only on IFactory

* Handle FilesTreeController requires IFileSystem of type PhysicalFileSystem

* Handle registration of default MediaFileSystem without using RegisterUniqueFor

* Remove RegisterFor / RegisterUniqueFor from IRegister

* Switch over from LightInject to wrappers around MSDI

* Made mapper dependencies more explicit

* Remove registration for AngularJsonMediaTypeFormatter

It's dependencies aren't registered so container validation fails

* Resolve lifetime issue for EnsureValidSessionId by service locating

else resolve scoped in singleton

* Make registration more explicit for backoffice UserManager

* Make install step registrations more explicit

* Disable service provider validation so site can launch

Maybe this is a problem maybe not, we build about 8000 service providers so maybe everything is fine later...

* Further cleanup of IFactory interface

* Further cleanup of IRegister interface

* Revert "Make registration more explicit for backoffice UserManager"

This reverts commit 7215fe836103c597cd0873c66737a79b91ed4c49.

* Resolve issue where NewInstallStep would fail to reset password for "SuperUser"

Before MSDI, somehow BackOfficeIdentityOptions would be configured with token provider map from IdentityBuilder.AddDefaultTokenProviders.
After switchover those config actions are lost.

Subclass IdentityBuilder to ensure BackOfficeIdentityOptions doesn't miss config setup upstream.

* Initialize current.

* Add todo to turn container validation back on.

* Migrated ScopeFileSystemsTests to integration tests

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

* Resolve issue where MediaFileSystem was skipping ShadowFileSystem

* Attempt to fix ScopeFileSystemsTests on azure devops

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

* Be interesting to know what the actual full path is in pipeline.

* Clarify intent of CreateMediaTest

Doesn't help resolve weird UnauthorizedAccessException but it cuts so much cognitive overhead for the future.

* Use ILoggerfactory rather than mock for the manually constructed file PhysicalFileSystem

* Maybe resolve failing test on azure pipeline.

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2020-10-26 11:47:14 +01:00
Bjarke Berg
7f9c1bb998 Merge pull request #9259 from umbraco/netcore/feature/migrate-persistance-tests
Netcore: Migrate Persistance Tests
2020-10-23 16:12:46 +02:00
Bjarke Berg
109ccb19b3 Merge pull request #9252 from umbraco/netcore/feature/AB8969-email-message-abstraction
NetCore: Email message abstraction
2020-10-23 14:20:10 +02:00
Bjarke Berg
b2b297ac8a Cleanup tests + Fixed issue in IOHelper related to contentroot vs webroot
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-23 13:58:30 +02:00
Bjarke Berg
5fe849c8e2 https://github.com/umbraco/Umbraco-CMS/pull/9252 - Changed EmailMessage to be completely immutable
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-23 12:37:23 +02:00
Mole
523a155d88 Fix integration test csproj 2020-10-23 10:11:35 +02:00
Mole
f6316c72dc Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/migrate-persistance-tests 2020-10-23 08:39:20 +02:00
Bjarke Berg
6e7f0502a3 Merge pull request #9221 from anthonydotnet/unique-nodename-refactor
Unique node name unit test fix & refactor
2020-10-23 07:16:25 +02:00
Bjarke Berg
1dd7384747 Merge remote-tracking branch 'origin/netcore/netcore' into unique-nodename-refactor 2020-10-22 20:04:14 +02:00
Bjarke Berg
532bbb7050 Merge pull request #9251 from umbraco/netcore/feature/compose_controllers
Netcore: Cleanup + Compose of controllers
2020-10-22 19:58:27 +02:00
Mole
8e321b4364 Migrate Querying tests 2020-10-22 15:31:56 +02:00
Mole
b28548849f Migrate the bare minimum of BaseUsingSqlCeSyntax to be able to migrate NPoco unit tests 2020-10-22 15:17:16 +02:00
Elitsa Marinovska
d7eca3d0d5 Abstracting MailMessage 2020-10-22 15:08:07 +02:00
Mole
016d3f2b5b Move NPoco unit tests back out of Integration tests 2020-10-22 14:50:01 +02:00
Mole
ba262648d9 Migrate NPocoTests 2020-10-22 14:12:07 +02:00
Mole
4f80ebd788 Migrate UnitOfWorkTests 2020-10-22 13:27:24 +02:00
Mole
14c55177f3 Migrate StylesheetRepositoryTest 2020-10-22 13:08:27 +02:00
Bjarke Berg
6905e5e734 Cleanup of different stuff that can be deleted from Umbraco.Web
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-10-22 12:25:52 +02:00
Mole
efc1817984 Migrate PartialViewRepositoryTests and ScriptRepositoryTest 2020-10-22 11:18:26 +02:00
Mole
bc0135a5c7 Migrate the remaining unit tests in UserRepositoryTest and delete the old file 2020-10-22 10:18:05 +02:00
Mole
0dc95edea4 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/migrate-persistance-tests 2020-10-22 09:49:40 +02:00
Mole
cdf009de0f Migrate TagRepositoryTest 2020-10-22 09:48:34 +02:00
Mole
e9ae1a93c3 Merge pull request #9245 from umbraco/netcore/bugfix/unit_tests_runnable_on_linux
Netcore: Ensure unit tests are runnable on linux
2020-10-22 08:23:15 +02:00
Anthony
759eee042f Refactored according to PR feedback. 2020-10-21 20:57:21 +01:00
berg
070307ea88 Ensure unit tests run on linux
Signed-off-by: berg <mail@bergmania.dk>
2020-10-21 21:04:10 +02:00
Bjarke Berg
5ecc2676e3 Migrated ThreadSafetyServiceTest.cs 2020-10-21 13:54:22 +02:00
Bjarke Berg
7e77feab1e Migrated ContentTypeServiceVariantsTests.cs 2020-10-21 13:47:52 +02:00
Mole
94c818e956 Migrate MemberTypeRepositoryTest 2020-10-21 13:45:29 +02:00
Mole
fcdd43692a Migrate MemberRepositoryTest 2020-10-21 13:28:13 +02:00
Emma L Garland
7a570110d0 Netcore/feature/healthcheck replaceconfiglogic (#8934)
* Started moving to JSON instead of config.
Mild refactoring but overall keeping it the same, except for injecting IConfiguration and JSON parsing instead of XML
Tests currently unaffected, need to increase coverage

* Moved to constants for appsettings keys
Moved from IConfiguration to global settings - later to be replaced with IOptions
Updated translation messages
Installed IOptions ready for new PR
Updated to new interface, IConfigurationService

* Post-merge fix

* Namespace move from Umbraco.Web to Umbraco.Core where appropriate

* Renamed abstractsettings (from abstractconfig)
Moving out of configservice into the POCO config check

* Made the IIsCustomErrors healthcheck as obsolete, as no web.config setting). Investigate reintroducing this check in the .NET Core way (UseDevelopment).
Reducing use of abstractsettings as not needed - we don't need a config service to read the config settings anymore as they're all explicit POCOs.
Consolidated health-checks in project.

* Removed test views that weren't meant to be added

* Returned to use of abstractsettings with different use

* Moved more health checks into correct folder/namespace, and enum into their own file

* Correct namespace

* Git history/compare lost due to file move, temporarily moving back to original folder. Will do another PR to move after this

* Use existing GetStatus in abstract check for Debug mode

* Updating to return to previous logic and putting files back into line

* Macro errors returned to previous logic

* Reuse abstractsettings class

* Swapped order to assist with reviewing PR

* Updated to include itempath

* Not implemented comment to avoid confusion
Implemented NotificationEmailCheck

* Changed to IOptionsMonitor as per PR comments. Removed configurationservice as we need to rethink the fixing strategy. Updated logger.
Needs to show fix message instead of fixing. Temporary fix for IIS version

* Switched to IOptionsMonitor for all

* No longer attempts to actually fix header in config. Still need to show suggestions.

Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
2020-10-21 11:29:25 +02:00
Mole
af9b0f5bfc Migrate PublicAccessRepositoryTest 2020-10-21 11:17:02 +02:00
Bjarke Berg
2bb3afb69d Merge pull request #9227 from umbraco/netcore/feature/migrate-unit-tests
Netcore: Migrate rendering related unit tests
2020-10-21 10:51:12 +02:00
Mole
be1530a80a Migrate MediaTypeRepositoryTest 2020-10-21 10:49:29 +02:00
Mole
231fe8455a Migrate MediaRepositoryTest 2020-10-21 10:30:06 +02:00
Mole
edbe6f050d Fix merge 2020-10-21 09:00:14 +02:00
Mole
78a6b81ccc Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/migrate-persistance-tests 2020-10-21 08:54:57 +02:00
Mole
90f3a70e8e Remove MapperTestBase and move functionality to TestHelper instead 2020-10-21 08:50:15 +02:00