Пример #1
0
        public void SaveExceptionThrow()
        {
            // Arrange
            var adventurer = new Adventurer()
            {
                Name = String.Empty
            };

            // Act
            adventurer.Save();
        }
Пример #2
0
        public void SaveExceptionMessage()
        {
            // Arrange
            var adventurer = new Adventurer()
            {
                Name = String.Empty
            };
            var expected = "You must assign a name for the Adventurer before calling the Save() method.";

            // Act
            try
            {
                adventurer.Save();
            }
            catch (MissingMemberException exc)
            {
                // Assert
                Assert.AreEqual(expected, exc.Message);
            }
        }