Ejemplo n.º 1
0
        public void TestReverseWithNull()
        {
            var myStringObject = new MyStringClass();
            var reversedString = myStringObject.Reverse(null);

            Assert.That(reversedString, Is.Null);
        }
Ejemplo n.º 2
0
        public void TestReverse()
        {
            var myStringObject = new MyStringClass();
            var reversedString = myStringObject.Reverse("hello");

            Assert.That(reversedString, Is.EqualTo("olleh"));
        }
Ejemplo n.º 3
0
        public void WhenICallReverseTheLogAspectIsApplies()
        {
            var logger = new MyLogger();
            ObjectFactory.Initialize(x => x.For<ILogger>().Use(logger));

            var obj = new MyStringClass();
            var reverseHello = obj.Reverse("hello");

            Assert.That(reverseHello, Is.EqualTo("olleh"));
            Assert.That(logger.Messages.Count(), Is.EqualTo(0));
        }
Ejemplo n.º 4
0
        public void WhenICallReverseTheLogAspectIsApplies()
        {
            var logger = new MyLogger();

            ObjectFactory.Initialize(x => x.For <ILogger>().Use(logger));

            var obj          = new MyStringClass();
            var reverseHello = obj.Reverse("hello");

            Assert.That(reverseHello, Is.EqualTo("olleh"));
            Assert.That(logger.Messages.Count(), Is.EqualTo(0));
        }
Ejemplo n.º 5
0
 public void TestReverseWithNull()
 {
     var myStringObject = new MyStringClass();
     var reversedString = myStringObject.Reverse(null);
     Assert.That(reversedString, Is.Null);
 }
Ejemplo n.º 6
0
 public void TestReverse()
 {
     var myStringObject = new MyStringClass();
     var reversedString = myStringObject.Reverse("hello");
     Assert.That(reversedString, Is.EqualTo("olleh"));
 }