-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from Sitecore/feature/33/helix-examples-refere…
…nces [#33] Update what we can in Helix Docs to reference Helix Basic Company
- Loading branch information
Showing
51 changed files
with
385 additions
and
334 deletions.
There are no files selected for viewing
Binary file added
BIN
+55.1 KB
helix/devops/development/_static/basic-company-tds-deployment-build.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+54.4 KB
helix/devops/development/_static/basic-company-tds-deployment-sources.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+25.6 KB
helix/devops/development/_static/basic-company-unicorn-hpp-reference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+8.09 KB
helix/devops/testing/_static/basic-company-navigation-tests-visualstudio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,27 @@ | ||
Unit tests | ||
~~~~~~~~~~ | ||
|
||
There is a fair number of unit testing approaches and frameworks for | ||
There are a fair number of unit testing approaches and frameworks for | ||
.NET and Sitecore, but as with other technologies and methodologies, | ||
Helix does not dictate which to choose. We do emphasise the value of | ||
adding unit tests to your business logic, and highly encourage the | ||
general practice. | ||
|
||
On disk, unit test projects should be contained in the /tests folder | ||
On disk, unit test projects should be contained in the ``/tests`` folder | ||
below the module folder. In Visual Studio the unit test project should | ||
be in the same Visual Studio solution as the corresponding module | ||
projects and contained with the module solution folder. | ||
|
||
.. admonition:: Habitat Example | ||
.. admonition:: Sitecore Helix Examples | ||
|
||
.. figure:: _static/image46.png | ||
.. figure:: _static/basic-company-navigation-tests-visualstudio.png | ||
|
||
Figure: Unit Test Project in Visual Studio | ||
|
||
.. admonition:: Habitat Example | ||
|
||
Unit Tests in Habitat are developed as Arrange-Act-Assert and uses the | ||
Unit Tests in Helix Examples are developed as Arrange-Act-Assert and use the | ||
following modules: | ||
|
||
- xUnit (https://xunit.github.io) framework as the main unit testing framework | ||
- NSubstitute (http://nsubstitute.github.io/) for mocking objects | ||
- AutoFixture (https://github.com/AutoFixture/AutoFixture) for “Arranging” the unit tests | ||
- FluentAssertions (http://www.fluentassertions.com/) for the assertion syntax | ||
- FakeDb (https://github.com/sergeyshushlyapin/Sitecore.FakeDb) for faking Sitecore objects and services | ||
|
||
Example of a Habitat unit test for Sitecore.Feature.Language.LanguageRepository: | ||
|
||
.. code-block:: csharp | ||
public class LanguageRepositoryTests | ||
{ | ||
[Theory] | ||
[AutoDbData] | ||
public void GetActive_ShouldReturnLanguageModelForContextLanguage(Db db, [Content] DbItem item) | ||
{ | ||
var contextItem = db.GetItem(item.ID); | ||
Context.Item = contextItem; | ||
var activeLanguage = LanguageRepository.GetActive(); | ||
activeLanguage.TwoLetterCode.Should().BeEquivalentTo(Context.Language.Name); | ||
} | ||
} | ||
- `xUnit <https://xunit.github.io>`__ framework as the main unit testing framework | ||
- `Moq <https://github.com/moq/moq4>`__ for mocking objects | ||
- `FakeDb <https://github.com/sergeyshushlyapin/Sitecore.FakeDb>`__ for faking Sitecore objects and services | ||
|
Binary file added
BIN
+16 KB
...principles/architecture-principles/_static/basic-company-filesystem-folders.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.38 KB
...x/principles/architecture-principles/_static/basic-company-solution-folders.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Oops, something went wrong.