Skip to content

Commit

Permalink
Some houseworking in the tests,
Browse files Browse the repository at this point in the history
Work on my renderer
  • Loading branch information
LoneWandererProductions committed Jan 24, 2025
1 parent 0425800 commit 6f3ca13
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 213 deletions.
6 changes: 3 additions & 3 deletions CommonLibraryTests/DataFormatterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ public void GetFileEncodingUtf8FileReturnsAnsi8Encoding()
public void ReadCsvWithLayerKeywords_ReturnsCorrectLayers()
{
// Arrange
var filepath = "test.csv";
var separator = ',';
var layerKeyword = "Layer_";
const string filepath = "test.csv";
const char separator = ',';
const string layerKeyword = "Layer_";

// Create test CSV content
var csvContent = new List<string>
Expand Down
30 changes: 24 additions & 6 deletions CommonLibraryTests/MemoryVaultTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

namespace CommonLibraryTests
{
/// <summary>
/// Some basic tests for Memory Vault
/// </summary>
[TestClass]
public class MemoryVaultTests
{
Expand All @@ -24,8 +27,11 @@ public void TestInitialize()
_vault = MemoryVault<string>.Instance;
}

/// <summary>
/// Adds the data should return identifier.
/// </summary>
[TestMethod]
public void AddData_ShouldReturnIdentifier()
public void AddDataShouldReturnIdentifier()
{
// Arrange
var data = "TestData";
Expand All @@ -37,8 +43,11 @@ public void AddData_ShouldReturnIdentifier()
Assert.AreNotEqual(-1, identifier);
}

/// <summary>
/// Gets the data should return correct data.
/// </summary>
[TestMethod]
public void GetData_ShouldReturnCorrectData()
public void GetDataShouldReturnCorrectData()
{
// Arrange
var data = "TestData";
Expand All @@ -51,8 +60,11 @@ public void GetData_ShouldReturnCorrectData()
Assert.AreEqual(data, retrievedData);
}

/// <summary>
/// Removes the data should remove correct item.
/// </summary>
[TestMethod]
public void RemoveData_ShouldRemoveCorrectItem()
public void RemoveDataShouldRemoveCorrectItem()
{
// Arrange
var data = "TestData";
Expand All @@ -71,7 +83,7 @@ public void RemoveData_ShouldRemoveCorrectItem()
/// Adds the metadata should store metadata correctly.
/// </summary>
[TestMethod]
public void AddMetadata_ShouldStoreMetadataCorrectly()
public void AddMetadataShouldStoreMetadataCorrectly()
{
// Arrange
var data = "TestData";
Expand All @@ -91,8 +103,11 @@ public void AddMetadata_ShouldStoreMetadataCorrectly()
Assert.AreEqual(metadata.Identifier, retrievedMetadata.Identifier);
}

/// <summary>
/// Saves the should persist data.
/// </summary>
[TestMethod]
public void Save_ShouldPersistData()
public void SaveShouldPersistData()
{
// Arrange
var data = "TestData";
Expand All @@ -113,8 +128,11 @@ public void Save_ShouldPersistData()
Assert.AreEqual(data, retrievedData);
}

/// <summary>
/// Saves the should persist expired data correctly.
/// </summary>
[TestMethod]
public void Save_ShouldPersistExpiredDataCorrectly()
public void SaveShouldPersistExpiredDataCorrectly()
{
// Arrange
var data = "TestData";
Expand Down
39 changes: 0 additions & 39 deletions CommonLibraryTests/ProjectionCamera.cs

This file was deleted.

37 changes: 0 additions & 37 deletions CommonLibraryTests/Projections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,43 +242,6 @@ public void ModelMatrix()
Assert.IsTrue(check, "Vector not converted");
}

[TestMethod]
public void LeftRightBug()
{
var triangles = GenerateCube();

var transform = Transform.GetInstance();
var transform1 = Transform.GetInstance();
var transform2 = Transform.GetInstance();

var cache = new List<PolyTriangle>(triangles);

transform1.CameraType = transform2.CameraType = transform.CameraType = Cameras.Orbit;

transform1.DisplayType = transform2.DisplayType = transform.DisplayType = Display.Normal;


transform1.LeftCamera(0.5);
transform2.RightCamera(0.5);

var raster = new Projection { Debug = false };
var reference = raster.Generate(cache, transform);
var left = raster.Generate(cache, transform1);
var right = raster.Generate(cache, transform1);

Trace.WriteLine("Details:");

for (var i = 0; i < reference.Count; i++)
{
Trace.WriteLine("Base:");
Trace.WriteLine(reference[i].ToString());
Trace.WriteLine("left:");
Trace.WriteLine(left[i].ToString());
Trace.WriteLine("Right:");
Trace.WriteLine(right[i].ToString());
}
}

/// <summary>
/// Multiplies the matrix vector.
/// </summary>
Expand Down
90 changes: 0 additions & 90 deletions CommonLibraryTests/RenderingTests.cs

This file was deleted.

11 changes: 11 additions & 0 deletions RenderEngine/PixelData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using OpenTK.Mathematics;

namespace RenderEngine
{
public struct PixelData
{
public int X;
public int Y;
public Vector3 Color;
}
}
4 changes: 2 additions & 2 deletions RenderEngine/ShaderResources.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System;
// ReSharper disable UnusedType.Global

namespace RenderEngine
{
/// <summary>
/// A static class containing different shader programs (vertex and fragment shaders) for various rendering effects.
/// </summary>
public static class ShaderResource
internal static class ShaderResource
{
/// <summary>
/// Solid Color Shader
Expand Down
Loading

0 comments on commit 6f3ca13

Please sign in to comment.