예제 #1
0
        public void Equals_Both_Null_Returns_True()
        {
            // Arrange

            // Act
            var equals = QuotaOptions.Equals(null, null);

            // Assert
            Assert.True(equals);
        }
예제 #2
0
        private static async Task <int> OnGetQuota(QuotaOptions options)
        {
            Console.WriteLine($"Getting global storage quota for scid : {options.ServiceConfigurationId}, sandbox {options.Sandbox}");
            GlobalStorageQuotaInfo result =
                await TitleStorage.GetGlobalStorageQuotaAsync(options.ServiceConfigurationId, options.Sandbox);

            Console.WriteLine($"Total bytes : {result.QuotaBytes}, used bytes {result.UsedBytes}");

            return(0);
        }
예제 #3
0
        public void Equals_Second_Null_Returns_False()
        {
            var options1 = new QuotaOptions
            {
                Average = 10,
                Burst   = 100,
            };

            var equals = QuotaOptions.Equals(options1, null);

            Assert.False(equals);
        }
예제 #4
0
        public void Equals_First_Null_Returns_False()
        {
            var options2 = new QuotaOptions
            {
                Average = 20,
                Burst   = 200,
            };

            var equals = QuotaOptions.Equals(null, options2);

            Assert.False(equals);
        }
예제 #5
0
        public void DeepClone_Works()
        {
            var sut = new QuotaOptions
            {
                Average = 10,
                Burst   = 100,
            };

            var clone = sut.DeepClone();

            Assert.NotSame(sut, clone);
            Assert.Equal(sut.Average, clone.Average);
            Assert.Equal(sut.Burst, clone.Burst);
        }
예제 #6
0
        internal static bool Equals(QuotaOptions options1, QuotaOptions options2)
        {
            if (options1 == null && options2 == null)
            {
                return(true);
            }

            if (options1 == null || options2 == null)
            {
                return(false);
            }

            return(options1.Average == options2.Average &&
                   options1.Burst == options2.Burst);
        }
예제 #7
0
        public void DeepClone_Works()
        {
            // Arrange
            var sut = new QuotaOptions
            {
                Average = 10,
                Burst   = 100,
            };

            // Act
            var clone = sut.DeepClone();

            // Assert
            clone.Should().NotBeSameAs(sut);
            clone.Average.Should().Be(sut.Average);
            clone.Burst.Should().Be(sut.Burst);
        }
예제 #8
0
        public void Equals_Different_Value_Returns_False()
        {
            var options1 = new QuotaOptions
            {
                Average = 10,
                Burst   = 100,
            };

            var options2 = new QuotaOptions
            {
                Average = 20,
                Burst   = 200,
            };

            var equals = QuotaOptions.Equals(options1, options2);

            Assert.False(equals);
        }
예제 #9
0
        public void Equals_Same_Value_Returns_True()
        {
            var options1 = new QuotaOptions
            {
                Average = 10,
                Burst   = 100,
            };

            var options2 = new QuotaOptions
            {
                Average = 10,
                Burst   = 100,
            };

            var equals = QuotaOptions.Equals(options1, options2);

            Assert.True(equals);
        }
예제 #10
0
        public void Equals_Both_Null_Returns_True()
        {
            var equals = QuotaOptions.Equals(null, null);

            Assert.True(equals);
        }