public void GivenInmemoryRepositoryExistsAndIsInitialised()
        {
            _repository = GetRepository();

            _itemToBeSaved = Builder <StorableItem>
                             .CreateNew()
                             .With(q => q.Id = 1)
                             .Build();
        }
Example #2
0
    /// <summary>
    /// Checks whether or not the type of the given GameObject can be stored
    /// </summary>
    /// <param name="go">The Gameobject wich should be checked.</param>
    /// <returns>True, if the object is storable.</returns>
    private bool CanStore(GameObject go)
    {
        StorableItem item = go.GetComponent <StorableItem>();

        return(item != null && FitsStorage(item));
    }
 public void ThenInMemoryRepositoryShouldReturnARecord()
 {
     _result = _repository.FindById(_itemToSave.Id);
     _result.Should().Be(null);
 }
Example #4
0
 private bool FitsStorage(StorableItem item)
 {
     return(((minSize.x < 0 || minSize.x <= item.GetSize().x) && (maxSize.x < 0 || item.GetSize().x <= maxSize.x)) &&
            ((minSize.y < 0 || minSize.y <= item.GetSize().y) && (maxSize.y < 0 || item.GetSize().y <= maxSize.y)) &&
            ((minSize.z < 0 || minSize.z <= item.GetSize().z) && (maxSize.z < 0 || item.GetSize().z <= maxSize.z)));
 }
 public void WhenSystemFindsARecord()
 {
     _result = _repository.FindById(2);
 }