Esempio n. 1
0
        public void IsItAllRightWithNull_Lazy()
        {
            var lazy   = LazyFactory.CreateLazy <string>(() => null);
            var result = lazy.Get();

            Assert.AreEqual(result, null);
            Assert.AreEqual(result, lazy.Get());
        }
Esempio n. 2
0
        public void CheckWhetherSupplierCalledOnce_Lazy()
        {
            var lazy   = LazyFactory.CreateLazy(() => DateTime.Now);
            var result = lazy.Get();

            Assert.AreEqual(result, lazy.Get());
            Assert.AreEqual(result, lazy.Get());
        }
Esempio n. 3
0
        public void DoesItWorkAtAll_Lazy()
        {
            var lazy = LazyFactory.CreateLazy(() => 48);

            Assert.AreEqual(48, lazy.Get());
        }