Example #1
0
        public void NotSetAndGet_Should_OK()
        {
            var instanceHolder     = new NbConstHolder();
            var mockHolderItemAuto = instanceHolder.Get <MockHolderItemB>();

            mockHolderItemAuto.ShouldNotNull("mockHolderItemAuto");

            var mockHolderItemAuto2 = instanceHolder.Get <MockHolderItemB>();

            mockHolderItemAuto2.ShouldSame(mockHolderItemAuto);
        }
Example #2
0
        public void SetAndGet_Should_OK()
        {
            var instanceHolder = new NbConstHolder();
            var mockItem       = new MockHolderItem();

            instanceHolder.Set(mockItem);

            var holderMockItem = instanceHolder.Get <MockHolderItem>();

            holderMockItem.ShouldNotNull("holderMockItem");
            holderMockItem.ShouldSame(mockItem);

            var holderMockItem2 = instanceHolder.Get <MockHolderItem>();

            holderMockItem2.ShouldSame(mockItem);
        }
Example #3
0
 /// <summary>
 /// ctor
 /// </summary>
 static NbConstHolder()
 {
     Instance = new NbConstHolder();
 }