|
@@ -0,0 +1,87 @@
|
|
|
+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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|