Exemple #1
0
        public void NullToDoTargetTypeThrows()
        {
            var    mockToDo       = new MockToDo();
            string serializedToDo = JsonConvert.SerializeObject(mockToDo);

            Action action = () => JsonConvert.DeserializeObject <IToDo>(serializedToDo);

            action.Should().Throw <ApplicationException>();
        }
Exemple #2
0
        public void MissingToDoTargetTypeThrows()
        {
            var    mockToDo       = new MockToDo();
            string serializedToDo = JsonConvert.SerializeObject(mockToDo);

            serializedToDo = serializedToDo.Replace("\"TargetType\":null,", "");

            Action action = () => JsonConvert.DeserializeObject <IToDo>(serializedToDo);

            action.Should().Throw <ApplicationException>();
        }