public void ApplyResourcesWithNullLookupKey() { TestObject value = new TestObject(); StaticMessageSource msgSource = new StaticMessageSource(); #if !NET_1_0 try { msgSource.ApplyResources(value, null, CultureInfo.InvariantCulture); Assert.Fail("ArgumentNullException was expected"); } catch (ArgumentNullException e) { Assert.IsNotNull(e); } Assert.AreEqual(null, value.Name); Assert.AreEqual(0, value.Age); #else try { msgSource.ApplyResources(value, null, CultureInfo.InvariantCulture); Assert.Fail("Should not be supported in 1.0"); } catch (NotSupportedException e) { Assert.AreEqual("Operation not supported in .NET 1.0 Release.", e.Message); } #endif }
public void ApplyResourcesWithNullObject() { TestObject value = new TestObject(); StaticMessageSource msgSource = new StaticMessageSource(); msgSource.ApplyResources(null, "testObject", CultureInfo.InvariantCulture); Assert.AreEqual(null, value.Name); Assert.AreEqual(0, value.Age); }
public void ApplyResources() { TestObject value = new TestObject(); StaticMessageSource msgSource = new StaticMessageSource(); msgSource.ApplyResources(value, "testObject", CultureInfo.InvariantCulture); Assert.AreEqual("Mark", value.Name, "Name property value not applied."); Assert.AreEqual(35, value.Age, "Age property value not applied."); }
public void ApplyResources() { TestObject value = new TestObject(); StaticMessageSource msgSource = new StaticMessageSource(); #if !NET_1_0 msgSource.ApplyResources(value, "testObject", CultureInfo.InvariantCulture); Assert.AreEqual("Mark", value.Name, "Name property value not applied."); Assert.AreEqual(35, value.Age, "Age property value not applied."); #else try { msgSource.ApplyResources(value, "testObject", CultureInfo.InvariantCulture); Assert.Fail("Should not be supported in 1.0"); } catch (NotSupportedException e) { Assert.AreEqual("Operation not supported in .NET 1.0 Release.", e.Message); } #endif }
public void ApplyResourcesWithNullLookupKey() { TestObject value = new TestObject(); StaticMessageSource msgSource = new StaticMessageSource(); try { msgSource.ApplyResources(value, null, CultureInfo.InvariantCulture); Assert.Fail("ArgumentNullException was expected"); } catch (ArgumentNullException e) { Assert.IsNotNull(e); } Assert.AreEqual(null, value.Name); Assert.AreEqual(0, value.Age); }