コード例 #1
0
        public bool Equals(Number320 other)
        {
            bool t1 = LocationKey.Equals(other.LocationKey);
            bool t2 = DomainKey.Equals(other.DomainKey);

            return(t1 && t2);
        }
コード例 #2
0
        public bool Equals(Number480 other)
        {
            var t1 = LocationKey.Equals(other.LocationKey);
            var t2 = DomainKey.Equals(other.DomainKey);
            var t3 = ContentKey.Equals(other.ContentKey);

            return(t1 && t2 && t3);
        }
コード例 #3
0
ファイル: Number640.cs プロジェクト: lanicon/TomP2P.NET
        public bool Equals(Number640 other)
        {
            var t1 = LocationKey.Equals(other.LocationKey);
            var t2 = DomainKey.Equals(other.DomainKey);
            var t3 = ContentKey.Equals(other.ContentKey);
            var t4 = VersionKey.Equals(other.VersionKey);

            return(t1 && t2 && t3 && t4);
        }
コード例 #4
0
            public void Creates_Inventory_records_as_expected_on_success()
            {
                //Arrange
                var          expectedLotDate         = new DateTime(2012, 3, 29);
                const int    expectedLotDateSequence = 1;
                const int    expectedLotTypeId       = (int)LotTypeEnum.DeHydrated;
                const int    expectedItems           = 3;
                const int    quantity0   = 10;
                const int    quantity1   = 21;
                const int    quantity2   = 40001;
                const string toteKey0    = "tote0";
                const string toteKey1    = "tote-1";
                const string toteKey2    = "";
                const string varietyKey0 = "variety0";
                const string varietyKey1 = "variety1";

                var chileProductKey = new ChileProductKey(TestHelper.CreateObjectGraphAndInsertIntoDatabase <ChileProduct>(c => c.EmptyProduct().ChileState = ChileStateEnum.Dehydrated));
                var dehydratorKey   = new CompanyKey(TestHelper.CreateObjectGraphAndInsertIntoDatabase <Company>(c => c.SetCompanyTypes(CompanyType.Dehydrator)));

                var packagingProductKey0  = new PackagingProductKey(TestHelper.CreateObjectGraphAndInsertIntoDatabase <PackagingProduct>());
                var packagingProductKey1  = new PackagingProductKey(TestHelper.CreateObjectGraphAndInsertIntoDatabase <PackagingProduct>());
                var warehouseLocationKey0 = new LocationKey(TestHelper.CreateObjectGraphAndInsertIntoDatabase <Location>());
                var warehouseLocationKey1 = new LocationKey(TestHelper.CreateObjectGraphAndInsertIntoDatabase <Location>());

                //Act
                var result = Service.CreateChileMaterialsReceived(new ChileMaterialsReceivedParameters
                {
                    UserToken       = TestUser.UserName,
                    DateReceived    = expectedLotDate,
                    ChileProductKey = chileProductKey.KeyValue,
                    SupplierKey     = dehydratorKey.KeyValue,
                    TreatmentKey    = StaticInventoryTreatments.NoTreatment.ToInventoryTreatmentKey(),
                    Items           = new List <ChileMaterialsReceivedItemParameters>
                    {
                        new ChileMaterialsReceivedItemParameters
                        {
                            Quantity            = quantity0,
                            Variety             = varietyKey0,
                            PackagingProductKey = packagingProductKey0.KeyValue,
                            LocationKey         = warehouseLocationKey0.KeyValue,
                            ToteKey             = toteKey0
                        },
                        new ChileMaterialsReceivedItemParameters
                        {
                            Quantity            = quantity1,
                            Variety             = varietyKey0,
                            PackagingProductKey = packagingProductKey1.KeyValue,
                            LocationKey         = warehouseLocationKey0.KeyValue,
                            ToteKey             = toteKey1
                        },
                        new ChileMaterialsReceivedItemParameters
                        {
                            Quantity            = quantity2,
                            Variety             = varietyKey1,
                            PackagingProductKey = packagingProductKey0.KeyValue,
                            LocationKey         = warehouseLocationKey1.KeyValue,
                            ToteKey             = toteKey2
                        }
                    }
                });

                //Assert
                result.AssertSuccess();

                var inventory = RVCUnitOfWork.InventoryRepository.Filter(i => i.LotDateCreated == expectedLotDate && i.LotDateSequence == expectedLotDateSequence && i.LotTypeId == expectedLotTypeId).ToList();

                Assert.AreEqual(expectedItems, inventory.Count);

                var item = inventory.Single(i => i.Quantity == quantity0);

                Assert.IsTrue(packagingProductKey0.Equals(item));
                Assert.IsTrue(warehouseLocationKey0.Equals(item));
                Assert.IsTrue(NoTreatmentKey.Equals(item));
                Assert.AreEqual(toteKey0, item.ToteKey);

                item = inventory.Single(i => i.Quantity == quantity1);
                Assert.IsTrue(packagingProductKey1.Equals(item));
                Assert.IsTrue(warehouseLocationKey0.Equals(item));
                Assert.IsTrue(NoTreatmentKey.Equals(item));
                Assert.AreEqual(toteKey1, item.ToteKey);

                item = inventory.Single(i => i.Quantity == quantity2);
                Assert.IsTrue(packagingProductKey0.Equals(item));
                Assert.IsTrue(warehouseLocationKey1.Equals(item));
                Assert.IsTrue(NoTreatmentKey.Equals(item));
                Assert.AreEqual(toteKey2, item.ToteKey);
            }