예제 #1
0
 public void SetOnceProperty_ConstructAndSetTwice()
 {
     _ = new SetOnceProperty <string>("test", "test")
     {
         Value = "test",
     };
 }
예제 #2
0
        public void SetOnceProperty_GetWithoutSet()
        {
            var property1 = new SetOnceProperty <string>("test");

            Assert.IsFalse(property1.HasValue);
            Assert.AreEqual("test", property1.Value);
        }
예제 #3
0
        public void SetOnceProperty_ConstructAndSet()
        {
            var property1 = new SetOnceProperty <string>("test", "test");

            Assert.IsTrue(property1.HasValue);
            Assert.AreEqual("test", property1.Value);
        }
예제 #4
0
        public void SetOnceProperty_SetTwice()
        {
            var property1 = new SetOnceProperty <string>("test");

            Assert.IsFalse(property1.HasValue);
            property1.Value = "test";
            Assert.IsTrue(property1.HasValue);
            property1.Value = "test";
        }