123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- 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<string>(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<string>("Äàòà ïî óáûâàíèþ",DataOutputViewModel.Sort);
- }
- [Fact]
- public void CheckSortOnContains2()
- {
- DataOutputViewModel DataOutputVM = new DataOutputViewModel();
- Assert.Contains<string>("Äàòà ïî âîçðàñòàíèþ", DataOutputViewModel.Sort);
- }
- [Fact]
- public void CheclSelectedSortOnCorrect()
- {
- DataOutputViewModel DataOutputVM = new DataOutputViewModel();
- Assert.Equal("Äàòà ïî óáûâàíèþ",DataOutputVM.SelectedSort);
- }
- }
- }
|