public void ShouldFailWhenTargetMethodTakesArguments()
 {
     var provider = new SessionIdProviderUsingReflection { TargetInstance = new object(), TargetMethod = "ReferenceEquals" };
     
     var actual = Assert.Throws<InvalidOperationException>(() => { var dummy = provider.SessionId; });
     
     Assert.That(actual.Message, Is.EqualTo("No public zero arg method named ReferenceEquals found in type System.Object"));
 }
        public void ShouldFailWhenTargetMethodIsNotPublic()
        {
            var provider = new SessionIdProviderUsingReflection { TargetInstance = new object(), TargetMethod = "MemberwiseClone" };

            var actual = Assert.Throws<InvalidOperationException>(() => { var dummy = provider.SessionId; });
            
            Assert.That(actual.Message, Is.EqualTo("No public zero arg method named MemberwiseClone found in type System.Object"));
        }
 public void ShouldFailWhenTargetMethodNameIsEmpty()
 {
     var provider = new SessionIdProviderUsingReflection { TargetInstance = new object(), TargetMethod = " " };
     
     var actual = Assert.Throws<InvalidOperationException>(() => { var dummy = provider.SessionId; });
     
     Assert.That(actual.Message, Is.EqualTo("Missing TargetMethod"));
 }
 public void ShouldWorkWithPublicZeroArgMethod()
 {
     var provider = new SessionIdProviderUsingReflection { TargetInstance = new object(), TargetMethod = "ToString" };
     
     var actual = provider.SessionId;
     
     Assert.That(actual, Is.EqualTo("System.Object"));
 }