Exemplo n.º 1
0
 public void DoStuffWithNullValueWillThrow(NameAppender sut, ISomeContext ctx)
 {
     // Fixture setup
     // Exercise system and verify outcome
     Assert.Throws<ArgumentNullException>(() =>
         sut.DoStuff(null, ctx));
     // Teardown
 }
Exemplo n.º 2
0
 public void DoStuffWithNullValueWillThrow(NameAppender sut, ISomeContext ctx)
 {
     // Fixture setup
     // Exercise system and verify outcome
     Assert.Throws <ArgumentNullException>(() =>
                                           sut.DoStuff(null, ctx));
     // Teardown
 }
Exemplo n.º 3
0
        public string DoStuff(SomeValue value, ISomeContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            return context.Name;
        }
Exemplo n.º 4
0
        public string DoStuff(SomeValue value, ISomeContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            return(context.Name);
        }
Exemplo n.º 5
0
        public AddInClient(IEnumerable<IAddIn> addIns)
        {
            if (addIns == null)
            {
                throw new ArgumentNullException("addIns");
            }

            this.addIns = addIns;
            this.context = new AddInClientContext();
        }
Exemplo n.º 6
0
        public AddInClient(IEnumerable <IAddIn> addIns)
        {
            if (addIns == null)
            {
                throw new ArgumentNullException("addIns");
            }

            this.addIns  = addIns;
            this.context = new AddInClientContext();
        }
Exemplo n.º 7
0
        public void DoStuffWithNullContextWillThrow(SomeClass sut, SomeValue sv)
        {
            // Fixture setup
            ISomeContext nullContext = null;

            // Exercise system and verify outcome
            Assert.Throws <ArgumentNullException>(() =>
                                                  sut.DoStuff(sv, nullContext));
            // Teardown
        }
Exemplo n.º 8
0
 public string DoStuff(SomeValue value, ISomeContext context)
 {
     return(new string(value.Message.Reverse().ToArray()));
 }
Exemplo n.º 9
0
 public SomeService(ISomeContext context)
 {
     _context = context;
 }
Exemplo n.º 10
0
 public string DoStuff(SomeValue value, ISomeContext context)
 {
     return new string(value.Message.Reverse().ToArray());
 }
Exemplo n.º 11
0
 public void DoStuff(ISomeContext context)
 {
     // do something based on context
 }