public void CanNotReadExistingApplication()
            {
                ApplicationEntitlementProvider wrappedProvider = new ApplicationEntitlementProvider(new MockSecurityService());
                FormPreviewApplicationEntitlementProvider provider = new FormPreviewApplicationEntitlementProvider(wrappedProvider)
                {
                    ImpersonatedSession = new ImpersonatedSession(new Dictionary<string, string>
                                                                                                                       {
                                                                                                                           { "role-2", "role-2" }
                                                                                                                       })
                };

                Application application = new Application
                {
                    ApplicationId = "app-1",
                    FormId = "form-1",
                    OrganisationId = "org-1",
                    WorkflowState = "New"
                };

                User user = new User
                {
                    Id = "user-1"
                };
                user.Organisations.Add("org-1", "Organisation One");

                AccessLevel applicationAccess = provider.GetApplicationAccess(new SecureSession(user), application, this.roleList, 1);

                Assert.AreEqual(AccessLevel.NoAccess, applicationAccess);
            }
            public void PassThroughWhenPreviewNotActive()
            {
                ApplicationEntitlementProvider wrappedProvider = new ApplicationEntitlementProvider(new MockSecurityService());
                FormPreviewApplicationEntitlementProvider provider = new FormPreviewApplicationEntitlementProvider(wrappedProvider);

                Application application = new Application
                {
                    FormId = "form-1",
                    OrganisationId = "org-1",
                    WorkflowState = "New"
                };

                User user = new User
                {
                    Id = "user-1",
                    Roles = new Dictionary<string, string>
                            { { "role-1", "role-1" } }
                };
                user.Organisations.Add("org-1", "Organisation One");

                AccessLevel applicationAccess = provider.GetApplicationAccess(new SecureSession(user), application, this.roleList, 1);
                Assert.AreEqual(AccessLevel.Read, applicationAccess);
            }