Exemplo n.º 1
0
        public void TestGetAll()
        {
            var controller = new RecordsController();

            var result = controller.GetRecords() as List <Record>;

            Assert.AreEqual(2, result.Count);
        }
Exemplo n.º 2
0
        public void GetRecords_Returns_CollectionOfSensorDTO()
        {
            // Arrange
            var recordServiceMock = new Mock <IRecordService>();

            recordServiceMock.Setup(service => service
                                    .GetAllRecordsAsync(null))
            .Returns(Task.FromResult(GetAllRecords()));

            var loggerMock = new Mock <ILogger <RecordsController> >();

            var controller = new RecordsController(recordServiceMock.Object, loggerMock.Object);

            // Act
            var result = controller.GetRecords(null).GetAwaiter().GetResult();

            // Assert
            Assert.IsType <List <RecordDTO> >(result);
        }
Exemplo n.º 3
0
    public void Render()
    {
        List <SessionRecord> sessionRecords = recordsController.GetRecords();

        sessionRecords = sessionRecords.OrderByDescending(s => s.score).ToList();
        int iteration = 1;

        foreach (SessionRecord sessionRecord in sessionRecords)
        {
            GameObject newRow = Instantiate(recordRowPrefab);
            newRow.transform.parent = containerTranfsorm;
            RecordRow row = newRow.GetComponent <RecordRow>();
            row.SetInfo(sessionRecord);
            if (iteration >= maxCount)
            {
                break;
            }
            ++iteration;
        }
    }
Exemplo n.º 4
0
        public void GetAllRecordDBs()
        {
            int actual = recordsController.GetRecords().Result.Value.Count();

            Assert.AreEqual(8, actual);
        }