Skip to content

Commit 320ad01

Browse files
committed
Adding tests
1 parent c6c05a1 commit 320ad01

2 files changed

Lines changed: 31 additions & 5 deletions

File tree

Project.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
authors = ["Filipe Braida <filipebraida@gmail.com>"]
21
name = "ModelBasedCF"
32
uuid = "e5e64596-b6ca-11e8-20a9-11eddeb55bda"
3+
authors = ["Filipe Braida <filipebraida@gmail.com>"]
44
version = "0.1.0"
55

66
[deps]
77
Persa = "86800b63-3017-5277-aca5-15d7d6a5f2b2"
8+
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
9+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
10+
11+
[extras]
12+
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
13+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
14+
15+
[targets]
16+
test = ["Test", "DataFrames"]

test/runtests.jl

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
1-
using ModelBasedCF
2-
using Base.Test
1+
using Persa
2+
using Test
3+
using DataFrames
34

4-
# write your own tests here
5-
@test 1 == 2
5+
function createdummydatasetone()
6+
df = DataFrame()
7+
df[!, :user] = [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7]
8+
df[!, :item] = [1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 4, 5, 6, 2, 4, 5]
9+
df[!, :rating] = [2.5, 3.5, 3.0, 3.5, 2.5, 3.0, 3, 3.5, 1.5, 5, 3, 3.5, 2.5, 3.0, 3.5, 4.0, 3.5, 3.0, 4.0, 2.5, 4.5, 3.0, 4.0, 2.0, 3.0, 2.0, 3.0, 3.0, 4.0, 5.0, 3.5, 3.0, 4.5, 4.0, 1.0]
10+
return df
11+
end
12+
13+
function createdummydatasettwo()
14+
df = DataFrame()
15+
df[!, :user] = [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7]
16+
df[!, :item] = [1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 4, 5, 6, 2, 4, 5]
17+
df[!, :rating] = [2, 7, 3, 3, 8, 3, 3, 3, 1, 9, 3, 3, 2, 3, 10, 4, 3, 3, 4, 2, 4, 3, 4, 2, 3, 2, 3, 3, 4, 5, 9, 10, 7, 6, 8]
18+
return df
19+
end
20+
####
21+
22+
@test true

0 commit comments

Comments
 (0)