< Summary

Class:TermsOfServiceHUD_Should
Assembly:TermsOfServiceHUDTests
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/TermsOfServiceHUD/Tests/TermsOfServiceHUD_Should.cs
Covered lines:36
Uncovered lines:0
Coverable lines:36
Total lines:97
Line coverage:100% (36 of 36)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SetUp()0%330100%
TearDown()0%330100%
SetTheViewVisibleWhenModelNotNull()0%110100%
SetTheViewVisibleWhenModelNull()0%110100%
HideViewOnAgreed()0%110100%
HideViewOnDeclined()0%110100%
ShowAdultWarningProperly()0%110100%
HideAdultWarningProperly()0%110100%
ShowGamlingWarningProperly()0%110100%
HideGamlingWarningProperly()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/TermsOfServiceHUD/Tests/TermsOfServiceHUD_Should.cs

#LineLine coverage
 1using System.Collections;
 2using NUnit.Framework;
 3using UnityEngine.TestTools;
 4
 5public class TermsOfServiceHUD_Should : IntegrationTestSuite_Legacy
 6{
 87    protected override bool justSceneSetUp => true;
 8
 9    private TermsOfServiceHUDController controller;
 10    private TermsOfServiceHUDView view;
 11
 12    [UnitySetUp]
 13    protected override IEnumerator SetUp()
 14    {
 815        yield return base.SetUp();
 816        controller = new TermsOfServiceHUDController();
 817        view = controller.view;
 818    }
 19
 20    protected override IEnumerator TearDown()
 21    {
 822        controller.Dispose();
 823        yield return base.TearDown();
 824    }
 25
 26    [Test]
 27    public void SetTheViewVisibleWhenModelNotNull()
 28    {
 129        view.content.SetActive(false);
 30
 131        controller.ShowTermsOfService(new TermsOfServiceHUDController.Model());
 32
 133        Assert.IsTrue(view.content.activeSelf);
 134    }
 35
 36    [Test]
 37    public void SetTheViewVisibleWhenModelNull()
 38    {
 139        view.content.SetActive(true);
 40
 141        controller.ShowTermsOfService(null);
 42
 143        Assert.IsFalse(view.content.activeSelf);
 144    }
 45
 46    [Test]
 47    public void HideViewOnAgreed()
 48    {
 149        controller.ShowTermsOfService(new TermsOfServiceHUDController.Model());
 50
 151        view.agreedButton.onClick.Invoke();
 52
 153        Assert.IsFalse(view.content.activeSelf);
 154    }
 55
 56    [Test]
 57    public void HideViewOnDeclined()
 58    {
 159        controller.ShowTermsOfService(new TermsOfServiceHUDController.Model());
 60
 161        view.declinedButton.onClick.Invoke();
 62
 163        Assert.IsFalse(view.content.activeSelf);
 164    }
 65
 66    [Test]
 67    public void ShowAdultWarningProperly()
 68    {
 169        controller.ShowTermsOfService(new TermsOfServiceHUDController.Model() { adultContent = true });
 70
 171        Assert.IsTrue(view.adultContent.activeSelf);
 172    }
 73
 74    [Test]
 75    public void HideAdultWarningProperly()
 76    {
 177        controller.ShowTermsOfService(new TermsOfServiceHUDController.Model() { adultContent = false });
 78
 179        Assert.IsFalse(view.adultContent.activeSelf);
 180    }
 81
 82    [Test]
 83    public void ShowGamlingWarningProperly()
 84    {
 185        controller.ShowTermsOfService(new TermsOfServiceHUDController.Model() { gamblingContent = true });
 86
 187        Assert.IsTrue(view.gamblingContent.activeSelf);
 188    }
 89
 90    [Test]
 91    public void HideGamlingWarningProperly()
 92    {
 193        controller.ShowTermsOfService(new TermsOfServiceHUDController.Model() { gamblingContent = false });
 94
 195        Assert.IsFalse(view.gamblingContent.activeSelf);
 196    }
 97}