public void Priority_ReturnsInteger_WhenCalled() { // Arrange CellInformation info = CreateCellInformation(); NewbornRule sut = CreateSut(); // Act sut.Apply(info); // Assert sut.Priority.ShouldEqual(4); }
public void Apply_SetsStatusToDead_WhenCalled() { // Arrange CellInformation info = CreateCellInformation(); NewbornRule sut = CreateSut(); // Act sut.Apply(info); // Assert info.Status.ShouldEqual(Cell.Status.Dead); }
public void Initialize_AddsMoreThanRule_WhenCalled() { // Arrange CellInformation info = CreateCellInformation(); NewbornRule sut = CreateSut(); // Act sut.Initialize(info); // Assert sut.GetConditions().First().ShouldBeInstanceOf <IsEqual>(); }
public void Initialize_AddsConditions_WhenCalled() { // Arrange CellInformation info = CreateCellInformation(); NewbornRule sut = CreateSut(); // Act sut.Initialize(info); // Assert sut.GetConditions().Count().ShouldEqual(1); }
public void IsValid_ReturnsTrueOrFalse_ForGivenNeighbours(int neighbours, bool expected) { // Arrange CellInformation info = CreateCellInformation(neighbours); NewbornRule sut = CreateSut(); sut.Initialize(info); // Act bool actual = sut.IsValid(); // Assert Assert.Equal(expected, actual); }
private NewbornRule CreateSut() { var newbornRule = new NewbornRule(); return(newbornRule); }