using LoginGenerator.Models; using LoginGenerator.ViewModels; namespace UnitTestsForAssistant { public class UnitTest1 { [Fact] public void PasswordIsNotNull() { PasswordGenerator pg = new PasswordGenerator(); string result = pg.Execute(); Assert.NotNull(result); } [Fact] public void PasswordIsStringl() { PasswordGenerator pg = new PasswordGenerator(); string result = pg.Execute(); Assert.IsType(result); } [Fact] public void PasswordIsCorrectCount() { PasswordGenerator pg = new PasswordGenerator(); string result = pg.Execute(); Assert.Equal(8, result.Count()); } [Fact] public void TransletirationCorrect() { Transliteration tl = new Transliteration(); string result = tl.Execute("Тест"); Assert.Equal("Test",result); } [Fact] public void TransletirationCountCorrect() { Transliteration tl = new Transliteration(); string result = tl.Execute("Тест"); Assert.Equal(4, result.Count()); } [Fact] public void CheckOnSmoothCorrectOnFalse() { GeneratePageViewModel GeneratePageVM = new GeneratePageViewModel(); GeneratePageVM.FIO = "TestTestTest"; bool result = GeneratePageVM.CheckOnSmoothly(); Assert.False(result); } [Fact] public void CheckOnSmoothCorrectOnTrue() { GeneratePageViewModel GeneratePageVM = new GeneratePageViewModel(); GeneratePageVM.FIO = "Test Test Test"; bool result = GeneratePageVM.CheckOnSmoothly(); Assert.True(result); } [Fact] public void CheckSortOnContains() { DataOutputViewModel DataOutputVM = new DataOutputViewModel(); Assert.Contains("Дата по убыванию",DataOutputViewModel.Sort); } [Fact] public void CheckSortOnContains2() { DataOutputViewModel DataOutputVM = new DataOutputViewModel(); Assert.Contains("Дата по возрастанию", DataOutputViewModel.Sort); } [Fact] public void CheclSelectedSortOnCorrect() { DataOutputViewModel DataOutputVM = new DataOutputViewModel(); Assert.Equal("Дата по убыванию",DataOutputVM.SelectedSort); } } }