Skip to content

Commit b7943ef

Browse files
committed
Moved docs
Preping devkit website
1 parent 69b4b5d commit b7943ef

31 files changed

Lines changed: 477 additions & 359 deletions

devkit_unity/Assets/_DevKit/Nexus/Runtime/MVVM/BaseViewModel.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,6 @@ public virtual string Name
3434
/// <inheritdoc/>
3535
public virtual DateTime? UpdateTime { get; set; }
3636

37-
/// <summary>
38-
/// Default ctor
39-
/// </summary>
40-
protected BaseViewModel()
41-
{
42-
IsUpdateSuspended = true;
43-
}
44-
4537
/// <summary>
4638
/// Validates property's value and returns the text with error or empty/null if value is valid
4739
/// </summary>

devkit_unity/Assets/_DevKit/Nexus/Tests/Editor/Binding/CollectionBindingTest.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using DevKit.Core.Observables;
12
using DevKit.Nexus.Binding;
23
using DevKit.Nexus.Binding.API;
34
using DevKit.Nexus.Tests.Editor.Binding.Models;
@@ -14,10 +15,10 @@ public void BindingManager_ObservableList_OneWayBinding_SimplePath_Test()
1415
var targetModel = new SimpleModel();
1516
const string targetPath = nameof(targetModel.List);
1617

17-
var sourceModel = new ObservableViewModel
18-
{
19-
List = { "a", "b", "c" }
20-
};
18+
var go = new GameObject();
19+
var sourceModel = go.AddComponent<ObservableViewModelTestFixture>();
20+
sourceModel.List = new ObservableCollection<string>{ "a", "b", "c" }; // initial values
21+
2122
sourceModel.Init();
2223
const string sourcePath = nameof(sourceModel.List);
2324

devkit_unity/Assets/_DevKit/Nexus/Tests/Editor/Binding/Models/ObservableViewModel.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using DevKit.Core.Observables;
2+
using DevKit.Nexus.MVVM;
3+
4+
namespace DevKit.Nexus.Tests.Editor.Binding.Models
5+
{
6+
public class ObservableViewModelTestFixture : BaseViewModel
7+
{
8+
public ObservableModel ChildModel { get; set; } = new();
9+
10+
public ObservableCollection<string> List { get; set; } = new();
11+
12+
// TODO implement test for this property
13+
public ObservableCollection<string, string> Dictionary { get; set; } = new();
14+
}
15+
}

devkit_unity/Assets/_DevKit/Nexus/Tests/Editor/Binding/Models/ObservableViewModel.cs.meta renamed to devkit_unity/Assets/_DevKit/Nexus/Tests/Editor/Binding/Models/ObservableViewModelTestFixture.cs.meta

File renamed without changes.

devkit_unity/Assets/_DevKit/Nexus/Tests/Editor/Binding/PropertyBindingTest.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ public void BindingManager_OneWayBinding_SimplePath_Test()
1313
{
1414
var targetModel = new SimpleModel();
1515
const string targetPath = nameof(targetModel.Name);
16-
17-
var sourceModel = new ObservableViewModel{ Name = Application.productName };
16+
17+
var go = new GameObject();
18+
var sourceModel = go.AddComponent<ObservableViewModelTestFixture>();
19+
sourceModel.Name = Application.productName;
1820
sourceModel.Init();
1921
const string sourcePath = nameof(sourceModel.Name);
2022

@@ -35,11 +37,13 @@ public void BindingManager_OneWayBinding_SimplePath_Test()
3537
[Test]
3638
public void BindingManager_TwoWayBinding_SimplePath_Test()
3739
{
38-
var targetModel = new ObservableViewModel();
40+
var go = new GameObject();
41+
var targetModel = go.AddComponent<ObservableViewModelTestFixture>();
3942
targetModel.Init();
4043
const string targetPath = nameof(targetModel.Name);
4144

42-
var sourceModel = new ObservableViewModel{ Name = Application.productName };
45+
var sourceModel = go.AddComponent<ObservableViewModelTestFixture>();
46+
sourceModel.Name = Application.productName;
4347
sourceModel.Init();
4448
const string sourcePath = nameof(sourceModel.Name);
4549

@@ -69,7 +73,8 @@ public void BindingManager_OneWayBinding_ComplexPath_Test()
6973
var targetModel = new SimpleModel();
7074
const string targetPath = nameof(targetModel.Name);
7175

72-
var sourceModel = new ObservableViewModel();
76+
var go = new GameObject();
77+
var sourceModel = go.AddComponent<ObservableViewModelTestFixture>();
7378
sourceModel.ChildModel.Name = Application.companyName;
7479
sourceModel.Init();
7580
const string sourcePath = nameof(sourceModel.ChildModel) + "." + nameof(sourceModel.ChildModel.Name);
@@ -91,11 +96,12 @@ public void BindingManager_OneWayBinding_ComplexPath_Test()
9196
[Test]
9297
public void BindingManager_TwoWayBinding_ComplexPath_Test()
9398
{
94-
var targetModel = new ObservableViewModel();
99+
var go = new GameObject();
100+
var targetModel = go.AddComponent<ObservableViewModelTestFixture>();
95101
targetModel.Init();
96102
const string targetPath = nameof(targetModel.Name);
97103

98-
var sourceModel = new ObservableViewModel();
104+
var sourceModel = go.AddComponent<ObservableViewModelTestFixture>();
99105
sourceModel.ChildModel.Name = Application.companyName;
100106
sourceModel.Init();
101107
const string sourcePath = nameof(sourceModel.ChildModel) + "." + nameof(sourceModel.ChildModel.Name);

docs/Images/billi_mika.png renamed to devkit_unity/Assets/_DevKit/PubSub/Docs/Images/billi_mika.png

File renamed without changes.

docs/Images/david_rex.png renamed to devkit_unity/Assets/_DevKit/PubSub/Docs/Images/david_rex.png

File renamed without changes.

docs/Images/demo_UI.png renamed to devkit_unity/Assets/_DevKit/PubSub/Docs/Images/demo_UI.png

File renamed without changes.

docs/Images/demo_struct.png renamed to devkit_unity/Assets/_DevKit/PubSub/Docs/Images/demo_struct.png

File renamed without changes.

0 commit comments

Comments
 (0)