InvalidOperationException

Namespace: AWSSDK.Shield
We found 10 examples in language CSharp for this search. You will see 44 fragments of code.

        /**
         * @throws InvalidOperationException on every invocation
         */
        public override IStateStore GetStateStore(string Name)
        {
            throw new InvalidOperationException("this should not happen: getStateStore() not supported in standby tasks.");
        }

        /**
         * @throws InvalidOperationException on every invocation
         */

        public void Forward(K key, V value)
        {
            throw new InvalidOperationException("this should not happen: forward() not supported in standby tasks.");
        }

        /**
         * @throws InvalidOperationException on every invocation
         */

        public void Forward(K key, V value, To to)
        {
            throw new InvalidOperationException("this should not happen: forward() not supported in standby tasks.");
        }

        /**
         * @throws InvalidOperationException on every invocation
         */

        [Obsolete]
        public void Forward(K key, V value, int childIndex)
        {
            throw new InvalidOperationException("this should not happen: forward() not supported in standby tasks.");
        }

        /**
         * @throws InvalidOperationException on every invocation
         */

        [Obsolete]
        public void Forward(K key, V value, string childName)
        {
            throw new InvalidOperationException("this should not happen: forward() not supported in standby tasks.");
        }

        /**
         * @throws InvalidOperationException on every invocation
         */

        public override void Commit()
        {
            throw new InvalidOperationException("this should not happen: commit() not supported in standby tasks.");
        }


        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Rename()
        {
            table.Rename(authentication, RandomUtility.NextIdentifier());
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Move()
        {
            table.Move(authentication, PathUtility.Separator);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Delete()
        {
            table.Delete(authentication);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void SetTags()
        {
            table.SetTags(authentication, TagInfo.All);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Copy()
        {
            table.Copy(authentication, RandomUtility.NextIdentifier(), PathUtility.Separator, true);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Inherit()
        {
            table.Inherit(authentication, RandomUtility.NextIdentifier(), PathUtility.Separator, true);
        }


        /// <summary>
        ///     Advances to the next row in the result set.
        /// </summary>
        /// <returns><see langword="true" /> if there are more rows; otherwise, <see langword="false" />. </returns>
        public override bool Read()
            => _closed
                ? throw new InvalidOperationException(Resources.DataReaderClosed(nameof(Read)))
                : (_record?.Read() ?? false);


        protected virtual HttpContext GetHttpContext()
        {
            return HttpContextAccessor.HttpContext ?? throw new InvalidOperationException("HttpContextAccessor.HttpContextIsNull");
        }


        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Rename()
        {
            type.Rename(authentication, RandomUtility.NextIdentifier());
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Move()
        {
            type.Move(authentication, PathUtility.Separator);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Delete()
        {
            type.Delete(authentication);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void SetTags()
        {
            type.SetTags(authentication, TagInfo.All);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Copy()
        {
            type.Copy(authentication, RandomUtility.NextIdentifier(), PathUtility.Separator);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Name()
        {
            Console.Write(type.Name);
        }

        IEnumerator<KeyValuePair<A, B>> IEnumerable<KeyValuePair<A, B>>.GetEnumerator()
        {
            throw new InvalidOperationException();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            throw new InvalidOperationException();
        }

        public void Add(KeyValuePair<A, B> item)
        {
            throw new InvalidOperationException();
        }

        void ICollection<KeyValuePair<A, B>>.Clear()
        {
            throw new InvalidOperationException();
        }

        public Boolean Contains(KeyValuePair<A, B> item)
        {
            throw new InvalidOperationException();
        }


        public void CopyTo(KeyValuePair<A, B>[] array,
                           Int32 arrayIndex)
        {
            throw new InvalidOperationException();
        }

		
		static void CompareResults(IList<AXmlObject> result1, IList<AXmlObject> result2)
		{
			for (int i = 0; i < Math.Min(result1.Count, result2.Count); i++) {
				CompareResults(result1[i], result2[i]);
			}
			if (result1.Count != result2.Count)
				throw new InvalidOperationException();
		}
			
			public override void VisitTag(AXmlTag tag)
			{
				if (textSource.GetText(tag.StartOffset, tag.OpeningBracket.Length) != tag.OpeningBracket)
					throw new InvalidOperationException();
				if (textSource.GetText(tag.NameSegment) != tag.Name)
					throw new InvalidOperationException();
				if (textSource.GetText(tag.EndOffset - tag.ClosingBracket.Length, tag.ClosingBracket.Length) != tag.ClosingBracket)
					throw new InvalidOperationException();
				base.VisitTag(tag);
			}
			
			public override void VisitAttribute(AXmlAttribute attribute)
			{
				if (textSource.GetText(attribute.NameSegment) != attribute.Name)
					throw new InvalidOperationException();
				base.VisitAttribute(attribute);
			}


        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Rename()
        {
            category.Rename(authentication, RandomUtility.NextIdentifier());
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Move()
        {
            category.Move(authentication, PathUtility.Separator);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Delete()
        {
            category.Delete(authentication);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void AddNewCategory()
        {
            category.AddNewCategory(authentication, RandomUtility.NextIdentifier());
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void NewType()
        {
            category.NewType(authentication);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Name()
        {
            Console.Write(category.Name);
        }


        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Rename()
        {
            category.Rename(authentication, RandomUtility.NextIdentifier());
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Move()
        {
            category.Move(authentication, PathUtility.Separator);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Delete()
        {
            category.Delete(authentication);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void AddNewCategory()
        {
            category.AddNewCategory(authentication, RandomUtility.NextIdentifier());
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void NewTable()
        {
            category.NewTable(authentication);
        }

        [TestMethod]
        [ExpectedException(typeof(InvalidOperationException))]
        public void Name()
        {
            Console.Write(category.Name);
        }


        [Test]
        public void DefaultConstructorWorks()
        {
            var ex = new InvalidOperationException();
            Assert.True((object)ex is InvalidOperationException, "is InvalidOperationException");
            Assert.AreEqual(null, ex.InnerException, "InnerException");
            Assert.AreEqual("Operation is not valid due to the current state of the object.", ex.Message);
        }

        [Test]
        public void ConstructorWithMessageWorks()
        {
            var ex = new InvalidOperationException("The message");
            Assert.True((object)ex is InvalidOperationException, "is InvalidOperationException");
            Assert.AreEqual(null, ex.InnerException, "InnerException");
            Assert.AreEqual("The message", ex.Message);
        }

        [Test]
        public void ConstructorWithMessageAndInnerExceptionWorks()
        {
            var inner = new Exception("a");
            var ex = new InvalidOperationException("The message", inner);
            Assert.True((object)ex is InvalidOperationException, "is InvalidOperationException");
            Assert.True(ReferenceEquals(ex.InnerException, inner), "InnerException");
            Assert.AreEqual("The message", ex.Message);
        }

Amazon.Shield.Model.InvalidOperationException : ISerializable

Constructors :

public InvalidOperationException(String message = )
public InvalidOperationException(String message = , Exception innerException = )
public InvalidOperationException(Exception innerException = )
public InvalidOperationException(String message = , Exception innerException = , ErrorType errorType = , String errorCode = , String requestId = , HttpStatusCode statusCode = )
public InvalidOperationException(String message = , ErrorType errorType = , String errorCode = , String requestId = , HttpStatusCode statusCode = )

Methods :

public ErrorType get_ErrorType()
public Void set_ErrorType(ErrorType value = )
public String get_ErrorCode()
public Void set_ErrorCode(String value = )
public String get_RequestId()
public Void set_RequestId(String value = )
public HttpStatusCode get_StatusCode()
public Void set_StatusCode(HttpStatusCode value = )
public MethodBase get_TargetSite()
public String get_Message()
public IDictionary get_Data()
public Exception GetBaseException()
public Exception get_InnerException()
public String get_HelpLink()
public Void set_HelpLink(String value = )
public String get_Source()
public Void set_Source(String value = )
public Void GetObjectData(SerializationInfo info = , StreamingContext context = )
public String ToString()
public Int32 get_HResult()
public Void set_HResult(Int32 value = )
public Type GetType()
public String get_StackTrace()
public Type GetType()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()