Exemplo n.º 1
0
        public virtual void TestSettingCtor()
        {
            SetOnce <Integer> set = new SetOnce <Integer>(new Integer(5));

            Assert.AreEqual(5, set.Get().value);
            Assert.Throws <AlreadySetException>(() => set.Set(new Integer(7)));
        }
Exemplo n.º 2
0
        public virtual void TestSettingCtor()
        {
            SetOnce <int?> set = new SetOnce <int?>(new int?(5));

            Assert.AreEqual(5, (int)set.Get());
            set.Set(new int?(7));
        }
Exemplo n.º 3
0
        public virtual void TestSettingCtor()
        {
            SetOnce <int?> set = new SetOnce <int?>(new int?(5));

            Assert.AreEqual(5, (int)set.Get());
            Assert.Throws <SetOnce <int?> .AlreadySetException>(() =>
            {
                set.Set(new int?(7));
            });
        }
Exemplo n.º 4
0
        public virtual void TestEmptyCtor()
        {
            SetOnce <Integer> set = new SetOnce <Integer>();

            Assert.IsNull(set.Get());
        }