Beispiel #1
0
		public static int Main()
		{
			TestItem1 ti = new TestItem2();
			ti.OnUpdate += delegate() { return 5;  };
			if (ti.Test() != 5)
				return 1;
			
			return 0;
		}
Beispiel #2
0
        public async Task Throws_when_items_types_are_different()
        {
            var newItem = new TestItem2()
            {
                Id = "test"
            };

            var ex = await Assert.ThrowsAsync <InvalidOperationException>(async() => await _changeTracker.TrackModifyAsync <NubeTable>(Item, newItem));

            Assert.Equal("Cannot compare objects of different types", ex.Message);
        }
Beispiel #3
0
        public static int Main()
        {
            TestItem1 ti = new TestItem2();

            ti.OnUpdate += delegate() { return(5); };
            if (ti.Test() != 5)
            {
                return(1);
            }

            return(0);
        }
        public void CanAddMultipleTypes()
        {
            var testItem1 = new TestItem1();
            _dictionaryCache.Cache(testItem1);

            var testItem2 = new TestItem2();
            _dictionaryCache.Cache(testItem2);

            var fetchedItem = _dictionaryCache.Fetch<TestItem1>(testItem1.AggregateIdentity);
            Assert.That(fetchedItem, Is.Not.Null);

            var expectNullItem = _dictionaryCache.Fetch<TestItem2>(testItem1.AggregateIdentity);
            Assert.That(expectNullItem, Is.Null);

            var secondItem = _dictionaryCache.Fetch<TestItem2>(testItem2.AggregateIdentity);
            Assert.That(secondItem, Is.Not.Null);
        }
Beispiel #5
0
        public void Setup()
        {
            EmptyInventory             = new InventoryType();
            OneItemInventory           = new InventoryType();
            TwoUniqueItemsInventory    = new InventoryType();
            TwoNonUniqueItemsInventory = new InventoryType();

            TestItem = Substitute.For <Item>(new object[] { "Test Item", "TestItems" });
            TestItem.CanUse(Arg.Any <IUsageContext>()).ReturnsForAnyArgs(false);

            TestItem2 = Substitute.For <Item>(new object[] { "Test2 Item", "Test2 Items" });
            TestItem2.CanUse(Arg.Any <IUsageContext>()).ReturnsForAnyArgs(false);

            OneItemInventory.Add(TestItem);
            TwoUniqueItemsInventory.Add(TestItem);
            TwoUniqueItemsInventory.Add(TestItem2);
            TwoNonUniqueItemsInventory.Add(TestItem);
            TwoNonUniqueItemsInventory.Add(TestItem);
        }