<commit_before>﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Globalization;
using System.Threading;
using System.Waf.Applications;
using System.Waf.UnitTesting;
using System.Waf.UnitTesting.Mocks;
using Waf.Writer.Applications.Services;
using Waf.Writer.Applications.ViewModels;

namespace Test.Writer.Applications.ViewModels
{
    [TestClass]
    public class ZoomViewModelTest : TestClassBase
    {
        private CultureInfo currentCulture;
        private IShellService shellService;
        private MockZoomViewModel zoomViewModel;

        protected override void OnInitialize()
        {
	        base.OnInitialize();
            currentCulture = Thread.CurrentThread.CurrentCulture;
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            shellService = Get<IShellService>();
            zoomViewModel = new MockZoomViewModel(new MockView(), shellService);
        }

        protected override void OnCleanup()
        {
	        base.OnCleanup();
            Thread.CurrentThread.CurrentCulture = currentCulture;
        }

        [TestMethod]
        public void DefaultZoomsTest()
        {
            AssertHelper.SequenceEqual(new[] { "200 %", "150 %", "125 %", "100 %", "75 %", "50 %" }, zoomViewModel.DefaultZooms);
        }

        [TestMethod]
        public void ZoomTest()
        {
            Assert.AreEqual(1d, zoomViewModel.Zoom);

            zoomViewModel.Zoom = 0.75;
            Assert.AreEqual(0.75, zoomViewModel.Zoom);

            zoomViewModel.ZoomInCommand.Execute(null);
            Assert.AreEqual(0.80, zoomViewModel.Zoom);<commit_msg>Writer: Minor code format improvement<commit_after>﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Globalization;
using System.Threading;
using System.Waf.Applications;
using System.Waf.UnitTesting;
using System.Waf.UnitTesting.Mocks;
using Waf.Writer.Applications.Services;
using Waf.Writer.Applications.ViewModels;

namespace Test.Writer.Applications.ViewModels
{
    [TestClass]
    public class ZoomViewModelTest : TestClassBase
    {
        private CultureInfo currentCulture;
        private IShellService shellService;
        private MockZoomViewModel zoomViewModel;

        protected override void OnInitialize()
        {
            base.OnInitialize();
            currentCulture = Thread.CurrentThread.CurrentCulture;
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            shellService = Get<IShellService>();
            zoomViewModel = new MockZoomViewModel(new MockView(), shellService);
        }

        protected override void OnCleanup()
        {
            base.OnCleanup();
            Thread.CurrentThread.CurrentCulture = currentCulture;
        }

        [TestMethod]
        public void DefaultZoomsTest()
        {
            AssertHelper.SequenceEqual(new[] { "200 %", "150 %", "125 %", "100 %", "75 %", "50 %" }, zoomViewModel.DefaultZooms);
        }

        [TestMethod]
        public void ZoomTest()
        {
            Assert.AreEqual(1d, zoomViewModel.Zoom);

            zoomViewModel.Zoom = 0.75;
            Assert.AreEqual(0.75, zoomViewModel.Zoom);

            zoomViewModel.ZoomInCommand.Execute(null);
            Assert.AreEqual(0.80, zoomViewModel.Zoom);
{'fraction_non_alphanumeric': 0.09484848484848485, 'fraction_numerical': 0.01575757575757576, 'mean_word_length': 2.6637069922308547, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4268258', 'n_tokens_mistral': 918, 'n_tokens_neox': 847, 'n_words': 163}