public void GlassLazyString_implicitly_converts_to_string() { // Arrange GlassLazy <string> glassLazy = new GlassLazy <string>(() => "Test String"); // Assert Assert.AreEqual("Test String", glassLazy.ToString()); Assert.IsTrue(glassLazy.IsValueCreated); Assert.IsTrue(glassLazy == "Test String"); }
public void GlassLazyString_implicitly_converts_to_string() { // Arrange GlassLazy<string> glassLazy = new GlassLazy<string>(() => "Test String"); // Assert Assert.AreEqual("Test String", glassLazy.ToString()); Assert.IsTrue(glassLazy.IsValueCreated); Assert.IsTrue(glassLazy == "Test String"); }
public void GlassLazyString_implicitly_converts_to_object() { // Arrange GlassLazy<LazyTestStub> glassLazy = new GlassLazy<LazyTestStub>(() => new LazyTestStub { Test = "Test String" }); LazyTestStub lazyStub = glassLazy; // Assert Assert.IsTrue(glassLazy.IsValueCreated); Assert.AreEqual("Glass.Mapper.Tests.GlassLazyTestFixture+LazyTestStub", glassLazy.ToString()); Assert.AreEqual(glassLazy.Value, lazyStub); Assert.IsTrue(lazyStub.Test == "Test String"); }
public void GlassLazyString_implicitly_converts_from_string() { // Arrange string target = "Test String"; // Act GlassLazy <string> glassLazy = target; // Assert Assert.AreEqual("Test String", glassLazy.ToString()); Assert.IsTrue(glassLazy == "Test String"); Assert.IsTrue(glassLazy.IsValueCreated); }
public void GlassLazyString_implicitly_converts_to_object() { // Arrange GlassLazy <LazyTestStub> glassLazy = new GlassLazy <LazyTestStub>(() => new LazyTestStub { Test = "Test String" }); LazyTestStub lazyStub = glassLazy; // Assert Assert.IsTrue(glassLazy.IsValueCreated); Assert.AreEqual("Glass.Mapper.Tests.GlassLazyTestFixture+LazyTestStub", glassLazy.ToString()); Assert.AreEqual(glassLazy.Value, lazyStub); Assert.IsTrue(lazyStub.Test == "Test String"); }