Ejemplo n.º 1
0
        public void Can_Build_StoreSettingsDisplay_From_StoreSettings()
        {
            var expectedSettings = StoreSettingService.GetAll();
            var settingDisplay   = new SettingDisplay();


            var actualSettings = settingDisplay.ToStoreSettingDisplay(expectedSettings);

            Assert.AreEqual(expectedSettings.First(x => x.Key == _currencyCodeKey).Value.ToLower().ToLower(), actualSettings.currencyCode.ToString().ToLower());
            Assert.AreEqual(expectedSettings.First(x => x.Key == _nextInvoiceNumberKey).Value.ToLower(), actualSettings.nextInvoiceNumber.ToString().ToLower());
            Assert.AreEqual(expectedSettings.First(x => x.Key == _nextOrderNumberkey).Value.ToLower(), actualSettings.nextOrderNumber.ToString().ToLower());
            Assert.AreEqual(expectedSettings.First(x => x.Key == _dateFormatKey).Value.ToLower(), actualSettings.dateFormat.ToLower());
            Assert.AreEqual(expectedSettings.First(x => x.Key == _timeFormatKey).Value.ToLower(), actualSettings.timeFormat.ToLower());
            Assert.AreEqual(expectedSettings.First(x => x.Key == _globalShippableKey).Value.ToLower(), actualSettings.globalShippable.ToString().ToLower());
            Assert.AreEqual(expectedSettings.First(x => x.Key == _globalShippingIsTaxableKey).Value.ToLower(), actualSettings.globalShippingIsTaxable.ToString().ToLower());
            Assert.AreEqual(expectedSettings.First(x => x.Key == _globalTaxableKey).Value.ToLower(), actualSettings.globalTaxable.ToString().ToLower());
            Assert.AreEqual(expectedSettings.First(x => x.Key == _globalTrackInventoryKey).Value.ToLower(), actualSettings.globalTrackInventory.ToString().ToLower());
        }
        public void Can_Retrieve_All_StoreSettings()
        {
            //// Arrange

            //// Act
            var settings = _settingsService.GetAll();

            //// Assert
            Assert.IsTrue(settings.Any());
            Assert.IsTrue(8 <= settings.Count());
        }