コード例 #1
0
        public void InvalidUseOfSomeImp()
        {
            // Fixture setup
            var something = new SomeImp();

            // Exercise system and verify outcome
            Assert.Throws <InvalidOperationException>(() =>
                                                      something.Message = "Ploeh");
            // Teardown
        }
コード例 #2
0
        public void ValidUseOfSomeImp()
        {
            // Fixture setup
            var something = new SomeImp();

            // Exercise system
            something.Initialize(new MyClass());
            something.Message = "Ploeh";
            // Verify outcome
            Assert.Equal <string>("Ploeh", something.Message);
            // Teardown
        }
コード例 #3
0
 public void ValidUseOfSomeImp()
 {
     // Fixture setup
     var something = new SomeImp();
     // Exercise system
     something.Initialize(new MyClass());
     something.Message = "Ploeh";
     // Verify outcome
     Assert.Equal<string>("Ploeh", something.Message);
     // Teardown
 }
コード例 #4
0
 public void InvalidUseOfSomeImp()
 {
     // Fixture setup
     var something = new SomeImp();
     // Exercise system and verify outcome
     Assert.Throws<InvalidOperationException>(() =>
         something.Message = "Ploeh");
     // Teardown
 }