示例#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));
        }
        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));
        }
示例#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));
        }
        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));
        }
示例#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!!"));
        }
        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));
        }
示例#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));
        }