Пример #1
0
        public void WhenMediumExchangeSetInstance_ThenReturnsNotNullInResponse()
        {
            int mediumMaxInstanceCount = 3;
            int response = 0;

            for (int i = 0; i < (mediumMaxInstanceCount + 1); i++)
            {
                response = mediumExchangeSetInstance.GetInstanceNumber(mediumMaxInstanceCount);
                Assert.IsInstanceOf(typeof(int), response);
                Assert.AreEqual(mediumExchangeSetInstance.GetCurrentInstanceNumber(), response);
                if (mediumExchangeSetInstance.GetCurrentInstanceNumber() != mediumMaxInstanceCount)
                {
                    Assert.AreNotEqual(mediumMaxInstanceCount, response);
                }
                else
                {
                    Assert.AreEqual(mediumMaxInstanceCount, response);
                }
            }
            Assert.AreEqual(1, response);
        }
Пример #2
0
 private (int, ExchangeSetType) GetInstanceCountBasedOnFileSize(double fileSizeInMB)
 {
     if (fileSizeInMB <= storageConfig.Value.SmallExchangeSetSizeInMB)
     {
         return(smallExchangeSetInstance.GetInstanceNumber(storageConfig.Value.SmallExchangeSetInstance), ExchangeSetType.sxs);
     }
     else if (fileSizeInMB > storageConfig.Value.SmallExchangeSetSizeInMB && fileSizeInMB <= storageConfig.Value.LargeExchangeSetSizeInMB)
     {
         return(mediumExchangeSetInstance.GetInstanceNumber(storageConfig.Value.MediumExchangeSetInstance), ExchangeSetType.mxs);
     }
     else
     {
         return(largeExchangeSetInstance.GetInstanceNumber(storageConfig.Value.LargeExchangeSetInstance), ExchangeSetType.lxs);
     }
 }