Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:SqlAclManager" /> class.
        /// </summary>
        /// <param name="storeEntry">The <see cref="StoreEntry"/> delegate.</param>
        /// <param name="deleteEntries">The <see cref="DeleteEntries"/> delegate.</param>
        /// <param name="renameResource">The <see cref="RenameResource"/> delegate.</param>
        /// <param name="retrieveAllEntries">The <see cref="RetrieveAllEntries"/> delegate.</param>
        /// <param name="retrieveEntriesForResource">The <see cref="RetrieveEntriesForResource"/> delegate.</param>
        /// <param name="retrieveEntriesForSubject">The <see cref="RetrieveEntriesForSubject"/> delegate.</param>
        public SqlAclManager(StoreEntry storeEntry, DeleteEntries deleteEntries, RenameResource renameResource,
                             RetrieveAllEntries retrieveAllEntries, RetrieveEntriesForResource retrieveEntriesForResource, RetrieveEntriesForSubject retrieveEntriesForSubject)
        {
            if (storeEntry == null)
            {
                throw new ArgumentNullException("storeEntry");
            }
            if (deleteEntries == null)
            {
                throw new ArgumentNullException("deleteEntries");
            }
            if (renameResource == null)
            {
                throw new ArgumentNullException("renameResource");
            }
            if (retrieveAllEntries == null)
            {
                throw new ArgumentNullException("retrieveAllEntries");
            }
            if (retrieveEntriesForResource == null)
            {
                throw new ArgumentNullException("retrieveEntriesForResource");
            }
            if (retrieveEntriesForSubject == null)
            {
                throw new ArgumentNullException("retrieveEntriesForSubject");
            }

            _storeEntry                 = storeEntry;
            _deleteEntries              = deleteEntries;
            _renameResource             = renameResource;
            _retrieveAllEntries         = retrieveAllEntries;
            _retrieveEntriesForResource = retrieveEntriesForResource;
            _retrieveEntriesForSubject  = retrieveEntriesForSubject;
        }
        public void RenameResourceCategory_UnitTest_ExecuteWithNullValues_ExpectedInvalidDataContractException()
        {
            var esb    = new RenameResource();
            var actual = esb.Execute(null, null);

            Assert.AreEqual(string.Empty, actual);
        }
        public void RenameResourceCategory_UnitTest_HandlesType_ExpectedReturnsRenameResourceCategoryService()
        {
            var esb    = new RenameResource();
            var result = esb.HandlesType();

            Assert.AreEqual("RenameResourceService", result);
        }
        public void RenameResourceCategory_UnitTest_ExecuteWithNoNewCategoryInValues_ExpectedInvalidDataContractException()
        {
            var esb    = new RenameResource();
            var actual = esb.Execute(new Dictionary <string, StringBuilder> {
                { Guid.Empty.ToString(), new StringBuilder("Test") }, { "Something", null }
            }, null);

            Assert.AreEqual(string.Empty, actual);
        }
        public void RenameResourceCategory_UnitTest_ExecuteWithBlankOldCategory_ExpectInvalidDataContractException()
        {
            var esb    = new RenameResource();
            var actual = esb.Execute(new Dictionary <string, StringBuilder> {
                { Guid.Empty.ToString(), new StringBuilder() }
            }, null);

            Assert.AreEqual(string.Empty, actual);
        }
        public void RenameResourceCategory_UnitTest_ExecuteWithNoOldCategoryInValues_ExpectedInvalidDataContractException()
        {
            var esb    = new RenameResource();
            var actual = esb.Execute(new Dictionary <string, StringBuilder> {
                { "DebugFilePath", null }
            }, null);

            Assert.AreEqual(string.Empty, actual);
        }
Example #7
0
        public void SetUp()
        {
            _mocks = new MockRepository();

            _storeEntry                 = _mocks.StrictMock <StoreEntry>();
            _deleteEntries              = _mocks.StrictMock <DeleteEntries>();
            _renameResource             = _mocks.StrictMock <RenameResource>();
            _retrieveAllEntries         = _mocks.StrictMock <RetrieveAllEntries>();
            _retrieveEntriesForResource = _mocks.StrictMock <RetrieveEntriesForResource>();
            _retrieveEntriesForSubject  = _mocks.StrictMock <RetrieveEntriesForSubject>();
        }
Example #8
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="T:SqlAclManager" /> class.
 /// </summary>
 /// <param name="storeEntry">The <see cref="StoreEntry" /> delegate.</param>
 /// <param name="deleteEntries">The <see cref="DeleteEntries" /> delegate.</param>
 /// <param name="renameResource">The <see cref="RenameResource" /> delegate.</param>
 /// <param name="retrieveAllEntries">The <see cref="RetrieveAllEntries" /> delegate.</param>
 /// <param name="retrieveEntriesForResource">The <see cref="RetrieveEntriesForResource" /> delegate.</param>
 /// <param name="retrieveEntriesForSubject">The <see cref="RetrieveEntriesForSubject" /> delegate.</param>
 public SqlAclManager(
     StoreEntry storeEntry,
     DeleteEntries deleteEntries,
     RenameResource renameResource,
     RetrieveAllEntries retrieveAllEntries,
     RetrieveEntriesForResource retrieveEntriesForResource,
     RetrieveEntriesForSubject retrieveEntriesForSubject)
 {
     _storeEntry                 = storeEntry ?? throw new ArgumentNullException(nameof(storeEntry));
     _deleteEntries              = deleteEntries ?? throw new ArgumentNullException(nameof(deleteEntries));
     _renameResource             = renameResource ?? throw new ArgumentNullException(nameof(renameResource));
     _retrieveAllEntries         = retrieveAllEntries ?? throw new ArgumentNullException(nameof(retrieveAllEntries));
     _retrieveEntriesForResource = retrieveEntriesForResource ?? throw new ArgumentNullException(nameof(retrieveEntriesForResource));
     _retrieveEntriesForSubject  = retrieveEntriesForSubject ?? throw new ArgumentNullException(nameof(retrieveEntriesForSubject));
 }
        public void RenameResourceCategory_UnitTest_CreateServiceEntry_ExpectedReturnsDynamicService()
        {
            var esb    = new RenameResource();
            var result = esb.CreateServiceEntry();

            Assert.AreEqual(esb.HandlesType(), result.Name);
            Assert.AreEqual("<DataList><ResourceID ColumnIODirection=\"Input\"/><NewName ColumnIODirection=\"Input\"/><Dev2System.ManagmentServicePayload ColumnIODirection=\"Both\"></Dev2System.ManagmentServicePayload></DataList>", result.DataListSpecification.ToString());
            Assert.AreEqual(1, result.Actions.Count);

            var serviceAction = result.Actions[0];

            Assert.AreEqual(esb.HandlesType(), serviceAction.Name);
            Assert.AreEqual(enActionType.InvokeManagementDynamicService, serviceAction.ActionType);
            Assert.AreEqual(esb.HandlesType(), serviceAction.SourceMethod);
        }
		/// <summary>
		/// Initializes a new instance of the <see cref="T:OracleAclManager" /> class.
		/// </summary>
		/// <param name="storeEntry">The <see cref="StoreEntry"/> delegate.</param>
		/// <param name="deleteEntries">The <see cref="DeleteEntries"/> delegate.</param>
		/// <param name="renameResource">The <see cref="RenameResource"/> delegate.</param>
		/// <param name="retrieveAllEntries">The <see cref="RetrieveAllEntries"/> delegate.</param>
		/// <param name="retrieveEntriesForResource">The <see cref="RetrieveEntriesForResource"/> delegate.</param>
		/// <param name="retrieveEntriesForSubject">The <see cref="RetrieveEntriesForSubject"/> delegate.</param>
		public OracleAclManager(StoreEntry storeEntry, DeleteEntries deleteEntries, RenameResource renameResource,
			RetrieveAllEntries retrieveAllEntries, RetrieveEntriesForResource retrieveEntriesForResource, RetrieveEntriesForSubject retrieveEntriesForSubject) {

			if(storeEntry == null) throw new ArgumentNullException("storeEntry");
			if(deleteEntries == null) throw new ArgumentNullException("deleteEntries");
			if(renameResource == null) throw new ArgumentNullException("renameResource");
			if(retrieveAllEntries == null) throw new ArgumentNullException("retrieveAllEntries");
			if(retrieveEntriesForResource == null) throw new ArgumentNullException("retrieveEntriesForResource");
			if(retrieveEntriesForSubject == null) throw new ArgumentNullException("retrieveEntriesForSubject");

			_storeEntry = storeEntry;
			_deleteEntries = deleteEntries;
			_renameResource = renameResource;
			_retrieveAllEntries = retrieveAllEntries;
			_retrieveEntriesForResource = retrieveEntriesForResource;
			_retrieveEntriesForSubject = retrieveEntriesForSubject;
		}
Example #11
0
        public void SetUp()
        {
            _mocks = new MockRepository();

            _storeEntry = _mocks.StrictMock<StoreEntry>();
            _deleteEntries = _mocks.StrictMock<DeleteEntries>();
            _renameResource = _mocks.StrictMock<RenameResource>();
            _retrieveAllEntries = _mocks.StrictMock<RetrieveAllEntries>();
            _retrieveEntriesForResource = _mocks.StrictMock<RetrieveEntriesForResource>();
            _retrieveEntriesForSubject = _mocks.StrictMock<RetrieveEntriesForSubject>();
        }