public void Reset_to_zero() { //Arrange int personId = 15; //Act PersonSequencer.Reset(); personId = PersonSequencer.NextPersonId(); //Assert Assert.Equal(1, personId); }
public void IncresId() { //Arrange int number = PersonSequencer.NextPersonId();// Onely works cuz its static int expected = number + 1; //Act int result = PersonSequencer.NextPersonId(); //Assert Assert.Equal(expected, result); }
public void PersonIdCountsUp() { //arrange int previousValue = PersonSequencer.NextPersonId(); int expected = previousValue + 1; //act int result = PersonSequencer.NextPersonId(); //assert Assert.Equal(expected, result); }
[Fact] //Test if increases by 1 public void TestIncreaseIdSequence() { //Arrange int expected = 1; // first person starts at 1; //Act PersonSequencer.Reset(); int actual = PersonSequencer.NextPersonId(); //Assert Assert.Equal(expected, actual); }
[Fact] //Test if it resets to 0 public void TestResetSequence() { //Arrange PersonSequencer.NextPersonId(); int personIdReset = 1; //Act PersonSequencer.Reset(); int resetId = PersonSequencer.NextPersonId(); //Assert Assert.Equal(personIdReset, resetId); }
public void RunReset() { //Run reset before act to remove possible static values PersonSequencer.Reset(); //Arrange & //Act int firstId = PersonSequencer.NextPersonId(); PersonSequencer.Reset(); int secondId = PersonSequencer.NextPersonId(); //Assert Assert.Equal(1, secondId); }
public void RunNextPersonId() { PersonSequencer.Reset(); //Arrange int firstId = 1; int secondId = 2; //Act int firstResult = PersonSequencer.NextPersonId(); int secondResult = PersonSequencer.NextPersonId(); //Assert Assert.Equal(firstId, firstResult); Assert.Equal(secondId, secondResult); PersonSequencer.Reset(); }
public void ResetToZero() { //arrange int expected = 1; // To be sure there tested numbers stored in personId variabal for (int i = 0; i < 10; i++) { PersonSequencer.NextPersonId(); } //act PersonSequencer.Reset(); int result = PersonSequencer.NextPersonId(); //Assert to be sure the reset acts to reset the personId Assert.Equal(expected, result); }
public void PersonIdCountUpResets() { //Arrange int expected = 1; for (int i = 0; i < 10; i++) { PersonSequencer.NextPersonId(); } //Act PersonSequencer.Reset(); int result = PersonSequencer.NextPersonId(); //Assert Assert.Equal(expected, result); }
public Person(string firstname, string lastname) //Constructor { PersonId = PersonSequencer.NextPersonId(); //Uses PersonSequencer to get next id. FirstName = firstname; LastName = lastname; }