Exemple #1
0
        public void GivenEditProvider_WhenCreate_ThenReturnManageProviderPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("EditProvider", 1);

            Assert.IsInstanceOfType(actual, typeof(ManageProviderPermission));
        }
Exemple #2
0
        public void GivenEditScheduledOffering_WhenCreate_ThenReturnManageAssignedOfferingPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("EditScheduledOffering", new StudentAssignedOffering());

            Assert.IsInstanceOfType(actual, typeof(ManageAssignedOfferingPermission));
        }
Exemple #3
0
        public void GivenSetServiceTypePrivacy_WhenCreate_ThenReturnSetServiceTypePrivacyPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("SetServiceTypePrivacy");

            Assert.IsInstanceOfType(actual, typeof(SetServiceTypePrivacyPermission));
        }
Exemple #4
0
        public void GivenSetFavoriteServiceOffering_WhenCreate_ThenReturnManageProviderPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("SetFavoriteServiceOffering", 1);

            Assert.IsInstanceOfType(actual, typeof(ManageProviderPermission));
        }
Exemple #5
0
        public void GivenStudentProfileExportCustomFieldData_WhenCreate_ThenReturnCustomFieldDataPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("StudentProfileExportCustomFieldData", new PublicField());

            Assert.IsInstanceOfType(actual, typeof(CustomFieldDataPermission));
        }
Exemple #6
0
        public void WhenCreateServiceRequestString_WhenCreate_ThenReturnManageServiceRequestPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("CreateServiceRequestString", new ServiceRequest());

            Assert.IsInstanceOfType(actual, typeof(ManageServiceRequestPermission));
        }
Exemple #7
0
        public void GivenScheduleOffering_WhenCreate_ThenReturnScheduleOfferingPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("ScheduleOffering", new List<Student> { new Student() }, new ServiceOffering());

            Assert.IsInstanceOfType(actual, typeof(ScheduleOfferingPermission));
        }
Exemple #8
0
        public void GivenProcessDataFile_WhenCreate_ThenReturnManageCustomFieldPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("ProcessDataFile", new Student());

            Assert.IsInstanceOfType(actual, typeof(ManageCustomFieldPermission));
        }
Exemple #9
0
        public void GivenDeleteServiceAttendance_WhenCreate_ThenReturnManageServiceAttendancePermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("DeleteServiceAttendance", new StudentAssignedOffering());

            Assert.IsInstanceOfType(actual, typeof(ManageServiceAttendancePermission));
        }
Exemple #10
0
        public void GivenGenerateStudentProfileExport_WhenCreate_ThenReturnViewStudentDetailPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("StudentProfileExportMapData", new Student());

            Assert.IsInstanceOfType(actual, typeof(ViewStudentDetailPermission));
        }
Exemple #11
0
        public void GivenCreateServiceRequest_WhenCreate_ThenReturnCreateServiceRequestPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("CreateServiceRequest", new List<Student>());

            Assert.IsInstanceOfType(actual, typeof(CreateServiceRequestPermission));
        }
        public void GivenDeleteRequest_WhenCreate_ThenReturnManageServiceRequestPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("DeleteRequest", new ServiceRequest());

            Assert.IsInstanceOfType(actual, typeof(ManageServiceRequestPermission));
        }
        public void GivenDeleteServiceAttendance_WhenCreate_ThenReturnManageServiceAttendancePermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("DeleteServiceAttendance", new StudentAssignedOffering());

            Assert.IsInstanceOfType(actual, typeof(ManageServiceAttendancePermission));
        }
        public void GivenCreateServiceRequest_WhenCreate_ThenReturnCreateServiceRequestPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("CreateServiceRequest", new List<Student>());

            Assert.IsInstanceOfType(actual, typeof(CreateServiceRequestPermission));
        }
        public void GivenCreateStudentNameString_WhenCreate_ThenReturnViewStudentDetailPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("CreateStudentNameString", new Student());

            Assert.IsInstanceOfType(actual, typeof(ViewStudentDetailPermission));
        }
Exemple #16
0
        public void GivenImportOfferingData_WhenCreate_ThenReturnImportOfferingDataPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("ImportOfferingData", new ServiceOffering());

            Assert.IsInstanceOfType(actual, typeof(ImportOfferingDataPermission));
        }
Exemple #17
0
        public void GivenCreateStudentNameString_WhenCreate_ThenReturnViewStudentDetailPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("CreateStudentNameString", new Student());

            Assert.IsInstanceOfType(actual, typeof(ViewStudentDetailPermission));
        }
        public void GivenActivityNameOnlyWhitespace_WhenCreate_ThenThrowException()
        {
            PermissionFactory target = new PermissionFactory();

            TestExtensions.ExpectException<ArgumentNullException>(() => target.Create("\r\n \t", new Dictionary<string, object>()));
        }
        public void GivenSetFavoriteServiceOffering_WhenCreate_ThenReturnManageProviderPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("SetFavoriteServiceOffering", 1);

            Assert.IsInstanceOfType(actual, typeof(ManageProviderPermission));
        }
        public void GivenViewStudentCustomFieldData_WhenCreate_ThenReturnCustomFieldDataPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("ViewStudentCustomFieldData", new PublicField());

            Assert.IsInstanceOfType(actual, typeof(CustomFieldDataPermission));
        }
        public void GivenUnrecognizedActivityName_WhenCreate_ThenThrowException()
        {
            PermissionFactory target = new PermissionFactory();

            target.ExpectException<InvalidOperationException>(() => target.Create("gibberish!!"));
        }
        public void GivenSetServiceTypePrivacy_WhenCreate_ThenReturnSetServiceTypePrivacyPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("SetServiceTypePrivacy");

            Assert.IsInstanceOfType(actual, typeof(SetServiceTypePrivacyPermission));
        }
Exemple #23
0
        public void GivenEmptyActivityName_WhenCreate_ThenThrowException()
        {
            PermissionFactory target = new PermissionFactory();

            TestExtensions.ExpectException<ArgumentNullException>(() => target.Create(string.Empty, new Dictionary<string, object>()));
        }
Exemple #24
0
        public void GivenUnrecognizedActivityName_WhenCreate_ThenThrowException()
        {
            PermissionFactory target = new PermissionFactory();

            target.ExpectException<InvalidOperationException>(() => target.Create("gibberish!!"));
        }
        public void GivenEditProvider_WhenCreate_ThenReturnManageProviderPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("EditProvider", 1);

            Assert.IsInstanceOfType(actual, typeof(ManageProviderPermission));
        }
        public void GivenScheduleOffering_WhenCreate_ThenReturnScheduleOfferingPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("ScheduleOffering", new List<Student> { new Student() }, new ServiceOffering());

            Assert.IsInstanceOfType(actual, typeof(ScheduleOfferingPermission));
        }
Exemple #27
0
        public void GivenActivityNameOnlyWhitespace_WhenCreate_ThenThrowException()
        {
            PermissionFactory target = new PermissionFactory();

            TestExtensions.ExpectException<ArgumentNullException>(() => target.Create("\r\n \t", new Dictionary<string, object>()));
        }
        public void GivenImportOfferingData_WhenCreate_ThenReturnImportOfferingDataPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("ImportOfferingData", new ServiceOffering());

            Assert.IsInstanceOfType(actual, typeof(ImportOfferingDataPermission));
        }
        public void GivenEmptyActivityName_WhenCreate_ThenThrowException()
        {
            PermissionFactory target = new PermissionFactory();

            TestExtensions.ExpectException<ArgumentNullException>(() => target.Create(string.Empty, new Dictionary<string, object>()));
        }
        public void GivenProcessDataFile_WhenCreate_ThenReturnManageCustomFieldPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("ProcessDataFile", new Student());

            Assert.IsInstanceOfType(actual, typeof(ManageCustomFieldPermission));
        }
        public void GivenEditScheduledOffering_WhenCreate_ThenReturnManageAssignedOfferingPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("EditScheduledOffering", new StudentAssignedOffering());

            Assert.IsInstanceOfType(actual, typeof(ManageAssignedOfferingPermission));
        }
        public void GivenGenerateStudentProfileExport_WhenCreate_ThenReturnViewStudentDetailPermission()
        {
            PermissionFactory target = new PermissionFactory();

            IPermission actual = target.Create("StudentProfileExportMapData", new Student());

            Assert.IsInstanceOfType(actual, typeof(ViewStudentDetailPermission));
        }