public void AddAppRolesAndFeatuers_Should_Set_Roles_And_Features_On_Identity()
        {
            // arrange
            var userDataAccessMock = new Mock <IUserDataAccess>();

            userDataAccessMock.Setup(m => m.GetUser(It.IsAny <string>())).Returns(new User
            {
                Roles = new List <ApplicationRole>
                {
                    new ApplicationRole {
                        Identifier = "APPO", Name = "Applikationsowner"
                    }
                },
                Features = new List <ApplicationFeature>
                {
                    ApplicationFeature.AdministrationEinstellungenBearbeiten,
                    ApplicationFeature.AuftragsuebersichtAuftraegeBegruendungVerwaltungsausleiheEdit
                }
            });

            var sut      = new AuthControllerHelper(null, userDataAccessMock.Object, null, null, null);
            var identity = new Identity();

            // act

            sut.AddAppRolesAndFeatures("1", identity);

            // asset
            identity.ApplicationRoles.First().Identifier = "APPO";
            identity.ApplicationFeatures.First().Identifier.Should().Be(ApplicationFeature.AdministrationEinstellungenBearbeiten.ToString());
            identity.ApplicationFeatures.Last().Identifier.Should()
            .Be(ApplicationFeature.AuftragsuebersichtAuftraegeBegruendungVerwaltungsausleiheEdit.ToString());
        }
        public void AddAppRolesAndFeatuers_When_Error_Should_Not_Throw()
        {
            // arrange
            var userDataAccessMock = new Mock <IUserDataAccess>();

            userDataAccessMock.Setup(m => m.GetUser(It.IsAny <string>())).Throws <Exception>();

            var sut = new AuthControllerHelper(null, userDataAccessMock.Object, null, null, null);

            // act

            var action = (Action)(() => { sut.AddAppRolesAndFeatures("1", new Identity()); });

            // asset
            action.Should().NotThrow();
        }