예제 #1
0
 public void Constructor_FitnessAndMessageAndInnerException_FitnessAndMessageAndInnerExcetion()
 {
     var target = new FitnessException(MockRepository.GenerateMock<IFitness>(), "1", new Exception("2"));
     Assert.IsNotNull(target.Fitness);
     Assert.AreEqual(target.Fitness.GetType().Name + ": 1", target.Message);
     Assert.AreEqual("2", target.InnerException.Message);
 }
예제 #2
0
        public void GetObjectData_InfoAndContext_Property()
        {
            var fitness = new FitnessStub();
            var target = new FitnessException(fitness, "1");
            var serializationInfo = new SerializationInfo(typeof(int), MockRepository.GenerateMock<IFormatterConverter>());
            target.GetObjectData(serializationInfo, new StreamingContext());

            Assert.AreEqual(fitness, serializationInfo.GetValue("Fitness", typeof(IFitness)));
        }
예제 #3
0
 public void Constructor_NoArgs_DefaultValue()
 {
     var target = new FitnessException();
     Assert.IsTrue(target.Message.Contains("FitnessException"));
 }
예제 #4
0
 public void Constructor_Message_Message()
 {
     var target = new FitnessException("1");
     Assert.AreEqual("1", target.Message);
 }
예제 #5
0
 public void Constructor_MessageAndInnerException_MessageAndInnerExcetion()
 {
     var target = new FitnessException("1", new Exception("2"));
     Assert.AreEqual("1", target.Message);
     Assert.AreEqual("2", target.InnerException.Message);
 }