コード例 #1
0
        public void GivenEditProvider_WhenCreate_ThenReturnManageProviderPermission()
        {
            PermissionFactory target = new PermissionFactory();

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

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

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

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

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

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

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

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

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

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

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

            Assert.IsInstanceOfType(actual, typeof(ManageServiceRequestPermission));
        }
コード例 #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));
        }
コード例 #8
0
        public void GivenProcessDataFile_WhenCreate_ThenReturnManageCustomFieldPermission()
        {
            PermissionFactory target = new PermissionFactory();

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

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

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

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

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

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

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

            Assert.IsInstanceOfType(actual, typeof(CreateServiceRequestPermission));
        }
コード例 #12
0
        public void GivenDeleteRequest_WhenCreate_ThenReturnManageServiceRequestPermission()
        {
            PermissionFactory target = new PermissionFactory();

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

            Assert.IsInstanceOfType(actual, typeof(ManageServiceRequestPermission));
        }
コード例 #13
0
        public void GivenDeleteServiceAttendance_WhenCreate_ThenReturnManageServiceAttendancePermission()
        {
            PermissionFactory target = new PermissionFactory();

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

            Assert.IsInstanceOfType(actual, typeof(ManageServiceAttendancePermission));
        }
コード例 #14
0
        public void GivenCreateServiceRequest_WhenCreate_ThenReturnCreateServiceRequestPermission()
        {
            PermissionFactory target = new PermissionFactory();

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

            Assert.IsInstanceOfType(actual, typeof(CreateServiceRequestPermission));
        }
コード例 #15
0
        public void GivenCreateStudentNameString_WhenCreate_ThenReturnViewStudentDetailPermission()
        {
            PermissionFactory target = new PermissionFactory();

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

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

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

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

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

            Assert.IsInstanceOfType(actual, typeof(ViewStudentDetailPermission));
        }
コード例 #18
0
        public void GivenActivityNameOnlyWhitespace_WhenCreate_ThenThrowException()
        {
            PermissionFactory target = new PermissionFactory();

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

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

            Assert.IsInstanceOfType(actual, typeof(ManageProviderPermission));
        }
コード例 #20
0
        public void GivenViewStudentCustomFieldData_WhenCreate_ThenReturnCustomFieldDataPermission()
        {
            PermissionFactory target = new PermissionFactory();

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

            Assert.IsInstanceOfType(actual, typeof(CustomFieldDataPermission));
        }
コード例 #21
0
        public void GivenUnrecognizedActivityName_WhenCreate_ThenThrowException()
        {
            PermissionFactory target = new PermissionFactory();

            target.ExpectException<InvalidOperationException>(() => target.Create("gibberish!!"));
        }
コード例 #22
0
        public void GivenSetServiceTypePrivacy_WhenCreate_ThenReturnSetServiceTypePrivacyPermission()
        {
            PermissionFactory target = new PermissionFactory();

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

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

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

            target.ExpectException<InvalidOperationException>(() => target.Create("gibberish!!"));
        }
コード例 #25
0
        public void GivenEditProvider_WhenCreate_ThenReturnManageProviderPermission()
        {
            PermissionFactory target = new PermissionFactory();

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

            Assert.IsInstanceOfType(actual, typeof(ManageProviderPermission));
        }
コード例 #26
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));
        }
コード例 #27
0
        public void GivenActivityNameOnlyWhitespace_WhenCreate_ThenThrowException()
        {
            PermissionFactory target = new PermissionFactory();

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

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

            Assert.IsInstanceOfType(actual, typeof(ImportOfferingDataPermission));
        }
コード例 #29
0
        public void GivenEmptyActivityName_WhenCreate_ThenThrowException()
        {
            PermissionFactory target = new PermissionFactory();

            TestExtensions.ExpectException<ArgumentNullException>(() => target.Create(string.Empty, new Dictionary<string, object>()));
        }
コード例 #30
0
        public void GivenProcessDataFile_WhenCreate_ThenReturnManageCustomFieldPermission()
        {
            PermissionFactory target = new PermissionFactory();

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

            Assert.IsInstanceOfType(actual, typeof(ManageCustomFieldPermission));
        }
コード例 #31
0
        public void GivenEditScheduledOffering_WhenCreate_ThenReturnManageAssignedOfferingPermission()
        {
            PermissionFactory target = new PermissionFactory();

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

            Assert.IsInstanceOfType(actual, typeof(ManageAssignedOfferingPermission));
        }
コード例 #32
0
        public void GivenGenerateStudentProfileExport_WhenCreate_ThenReturnViewStudentDetailPermission()
        {
            PermissionFactory target = new PermissionFactory();

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

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