public void GetMessageWithNoParentMessageSourceAndNullDefaultMessageSourceResolvableAndCulture()
        {
            IMessageSourceResolvable resolver = new DefaultMessageSourceResolvable(
                new string[] { "foo" }, new object[] {}, string.Empty);
            DelegatingMessageSource source = new DelegatingMessageSource();

            Assert.Throws <NoSuchMessageException>(() => source.GetMessage(resolver, CultureInfo.InvariantCulture));
        }
        public void GetMessageWithNoParentMessageSourceAndNullDefaultMessageSourceResolvableAndCulture()
        {
            IMessageSourceResolvable resolver = new DefaultMessageSourceResolvable(
                new string[] { "foo" }, new object[] {}, string.Empty);
            DelegatingMessageSource source = new DelegatingMessageSource();

            source.GetMessage(resolver, CultureInfo.InvariantCulture);
        }
Exemple #3
0
        public void GetMessageWithParams()
        {
            const string expectedName = "Rick Evans";

            A.CallTo(() => MockMessageSource.GetMessage(LookupKey, new string[] { "Rick", "Evans" })).Returns(expectedName);
            DelegatingMessageSource source = new DelegatingMessageSource(MockMessageSource);
            string name = source.GetMessage(LookupKey, "Rick", "Evans");

            Assert.AreEqual(expectedName, name);
        }
Exemple #4
0
        public void GetMessageWithCulture()
        {
            const string expectedName = "Rick Evans";

            A.CallTo(() => MockMessageSource.GetMessage(LookupKey, CultureInfo.InvariantCulture)).Returns(expectedName);
            DelegatingMessageSource source = new DelegatingMessageSource(MockMessageSource);
            string name = source.GetMessage(LookupKey, CultureInfo.InvariantCulture);

            Assert.AreEqual(expectedName, name);
        }
Exemple #5
0
        public void GetMessageWithNoParentMessageSourceAndMessageSourceResolvableAndCulture()
        {
            const string expectedName = "Rick Evans";

            IMessageSourceResolvable resolvable = A.Fake <IMessageSourceResolvable>();

            A.CallTo(() => resolvable.DefaultMessage).Returns(expectedName);

            DelegatingMessageSource source = new DelegatingMessageSource();
            string name = source.GetMessage(resolvable, CultureInfo.InvariantCulture);

            Assert.AreEqual(expectedName, name);
        }
        public void GetMessage()
        {
            const string expectedName = "Rick Evans";

            Expect.Call(MockMessageSource.GetMessage(LookupKey)).Return(expectedName);
            DelegatingMessageSource source
                = new DelegatingMessageSource(MockMessageSource);

            mocks.ReplayAll();
            string name = source.GetMessage(LookupKey);

            Assert.AreEqual(expectedName, name);
            mocks.VerifyAll();
        }
        public void GetMessageWithMessageSourceResolvableAndCulture()
        {
            const string            expectedName = "Rick Evans";
            DelegatingMessageSource source
                = new DelegatingMessageSource(MockMessageSource);

            Expect.Call(MockMessageSource.GetMessage((IMessageSourceResolvable)null, CultureInfo.InvariantCulture)).Return(expectedName);
            mocks.ReplayAll();
            string name = source.GetMessage(
                (IMessageSourceResolvable)null, CultureInfo.InvariantCulture);

            Assert.AreEqual(expectedName, name);
            mocks.VerifyAll();
        }
        public void GetMessageWithCultureAndParams()
        {
            const string expectedName = "Rick Evans";

            Expect.Call(MockMessageSource.GetMessage(LookupKey, CultureInfo.InvariantCulture, new string[] { "Rick", "Evans" }))
            .Return(expectedName);
            DelegatingMessageSource source
                = new DelegatingMessageSource(MockMessageSource);

            mocks.ReplayAll();
            string name = source.GetMessage(LookupKey, CultureInfo.InvariantCulture, "Rick", "Evans");

            Assert.AreEqual(expectedName, name);
            mocks.VerifyAll();
        }
        public void GetMessageWithNoParentMessageSourceAndMessageSourceResolvableAndCulture()
        {
            const string expectedName = "Rick Evans";

            IMessageSourceResolvable resolvable = mocks.StrictMock <IMessageSourceResolvable>();

            Expect.Call(resolvable.DefaultMessage).Return(expectedName);
            Expect.Call(resolvable.DefaultMessage).Return(expectedName);

            DelegatingMessageSource source = new DelegatingMessageSource();

            mocks.ReplayAll();
            string name = source.GetMessage(resolvable, CultureInfo.InvariantCulture);

            Assert.AreEqual(expectedName, name);
            //mock.Verify();
            mocks.VerifyAll();
        }
        public void GetMessageWithParamsNoDelegateTarget()
        {
            DelegatingMessageSource source = new DelegatingMessageSource();

            source.GetMessage(LookupKey, "Rick", "Evans");
        }
        public void GetMessageWithCultureNoDelegateTarget()
        {
            DelegatingMessageSource source = new DelegatingMessageSource();

            source.GetMessage(LookupKey, CultureInfo.InvariantCulture);
        }
        public void GetMessageNoDelegateTarget()
        {
            DelegatingMessageSource source = new DelegatingMessageSource();

            Assert.Throws <NoSuchMessageException>(() => source.GetMessage(LookupKey));
        }
		public void GetMessageNoDelegateTarget()
		{
			DelegatingMessageSource source = new DelegatingMessageSource();
            Assert.Throws<NoSuchMessageException>(() => source.GetMessage(LookupKey));
		}
 public void GetMessageWithMessageSourceResolvableAndCulture()
 {
     const string expectedName = "Rick Evans";
     DelegatingMessageSource source
         = new DelegatingMessageSource(MockMessageSource);
     Expect.Call(MockMessageSource.GetMessage((IMessageSourceResolvable)null, CultureInfo.InvariantCulture)).Return(expectedName);
     mocks.ReplayAll();
     string name = source.GetMessage(
         (IMessageSourceResolvable) null, CultureInfo.InvariantCulture);
     Assert.AreEqual(expectedName, name);
     mocks.VerifyAll();
 }
		public void GetMessageWithNoParentMessageSourceAndNullDefaultMessageSourceResolvableAndCulture()
		{
			IMessageSourceResolvable resolver = new DefaultMessageSourceResolvable(
				new string[] {"foo"}, new object[] {}, string.Empty);
			DelegatingMessageSource source = new DelegatingMessageSource();
            Assert.Throws<NoSuchMessageException>(() => source.GetMessage(resolver, CultureInfo.InvariantCulture));
		}
 public void GetMessageNoDelegateTarget()
 {
     DelegatingMessageSource source = new DelegatingMessageSource();
     source.GetMessage(LookupKey);
 }
 public void GetMessage()
 {
     const string expectedName = "Rick Evans";
     Expect.Call(MockMessageSource.GetMessage(LookupKey)).Return(expectedName);
     DelegatingMessageSource source
         = new DelegatingMessageSource(MockMessageSource);
     mocks.ReplayAll();
     string name = source.GetMessage(LookupKey);
     Assert.AreEqual(expectedName, name);
     mocks.VerifyAll();
 }
 public void GetMessageWithParamsNoDelegateTarget()
 {
     DelegatingMessageSource source = new DelegatingMessageSource();
     source.GetMessage(LookupKey, "Rick", "Evans");
 }
 public void GetMessageWithNoParentMessageSourceAndNullDefaultMessageSourceResolvableWithNoCodesAndCulture()
 {
     IMessageSourceResolvable resolver = new DefaultMessageSourceResolvable(
         new string[] {}, new object[] {}, string.Empty);
     DelegatingMessageSource source = new DelegatingMessageSource();
     source.GetMessage(resolver, CultureInfo.InvariantCulture);
 }
        public void GetMessageWithNoParentMessageSourceAndMessageSourceResolvableAndCulture()
        {
            const string expectedName = "Rick Evans";

            IMessageSourceResolvable resolvable =
                (IMessageSourceResolvable) mocks.CreateMock(typeof (IMessageSourceResolvable));
            Expect.Call(resolvable.DefaultMessage).Return(expectedName);
            Expect.Call(resolvable.DefaultMessage).Return(expectedName);

            DelegatingMessageSource source = new DelegatingMessageSource();
            mocks.ReplayAll();
            string name = source.GetMessage(resolvable, CultureInfo.InvariantCulture);
            Assert.AreEqual(expectedName, name);
            //mock.Verify();
            mocks.VerifyAll();
        }
        public void GetMessageWithCultureAndParamsNoDelegateTarget()
        {
            DelegatingMessageSource source = new DelegatingMessageSource();

            source.GetMessage(LookupKey, CultureInfo.InvariantCulture, "Rick", "Evans");
        }
 public void GetMessageWithCultureAndParamsNoDelegateTarget()
 {
     DelegatingMessageSource source = new DelegatingMessageSource();
     source.GetMessage(LookupKey, CultureInfo.InvariantCulture, "Rick", "Evans");
 }
        public void GetMessageWithCultureAndParamsNoDelegateTarget()
        {
            DelegatingMessageSource source = new DelegatingMessageSource();

            Assert.Throws <NoSuchMessageException>(() => source.GetMessage(LookupKey, CultureInfo.InvariantCulture, "Rick", "Evans"));
        }
 public void GetMessageWithCultureAndParams()
 {
     const string expectedName = "Rick Evans";
     Expect.Call(MockMessageSource.GetMessage(LookupKey, CultureInfo.InvariantCulture, new string[] {"Rick", "Evans"}))
         .Return(expectedName);
     DelegatingMessageSource source
         = new DelegatingMessageSource(MockMessageSource);
     mocks.ReplayAll();
     string name = source.GetMessage(LookupKey, CultureInfo.InvariantCulture, "Rick", "Evans");
     Assert.AreEqual(expectedName, name);
     mocks.VerifyAll();
 }
 public void GetMessageWithCultureNoDelegateTarget()
 {
     DelegatingMessageSource source = new DelegatingMessageSource();
     source.GetMessage(LookupKey, CultureInfo.InvariantCulture);
 }
        public void GetMessageNoDelegateTarget()
        {
            DelegatingMessageSource source = new DelegatingMessageSource();

            source.GetMessage(LookupKey);
        }
		public void GetMessageWithCultureAndParamsNoDelegateTarget()
		{
			DelegatingMessageSource source = new DelegatingMessageSource();
            Assert.Throws<NoSuchMessageException>(() => source.GetMessage(LookupKey, CultureInfo.InvariantCulture, "Rick", "Evans"));
		}